He uses formal language to cover his feeling because Hamlet is an example of dramatic poetry, which is one whose action is developed through dialogues. When the poem is dedicated to a solemn event and includes a tragic ending, the work belongs to the tragedy. Hamlet wants to take revenge on his uncle, and kill him. He uses formal language in order to be able to get close to his uncle; gain his trust and make his uncle confess the crime of having killed his father and finally have enough of a proof to continue his revenge, tough he lost everything he had along the way, such as the woman he loved.
Explanation:
I hope this passage helps you understand a little bit more!