http://www.thyorisons.com/#Cause_of_Lunacy
POLONIUS (2.2.52)
I have found the very cause of Hamlet's lunacy.
The word "lunacy" is derived from "luna," Latin for moon, because of an old belief that insanity was caused by the moon (or, I believe, in this play's metaphor, being like the moon).
When Polonius finally states the cause of Hamlet's lunacy, a small part of his babbling is "What majesty should be, what duty is," which, unknown to Polonius, really is precisely the cause. Hamlet is mad because duty demands that he become what majesty should be - a king. Yet Hamlet by nature is a man of reason, while kings are by nature "the question of these wars". Filial duty demands that Hamlet reflect the values of his father, but that way lies madness.
Hamlet compared his father to Hyperion. Hyperion was the Greek Titon god of the sun. Laertes compared Hamlet to the moon: "nature, crescent...waxes...If she unmask her beauty to the moon." In the Mousetrap, Hamlet is implicitly related to the moon by "thirty dozen moons with borrow'd sheen." The "thirty" relates to .Hamlet's age. "Borrow'd sheen" is a hint that Hamlet is reflecting his father's values rather than shining with his own true self - and that is indeed lunacy.
POLONIUS (1.3.78)
Neither a borrower nor a lender be; .... This above all: to thine ownself be true.
Polonius' daughter Ophelia had the same tragic flaw as Hamlet - she was untrue to herself by being too obedient to her father.
In 1986 Voyager 2 discovered a new moon of Uranus. Whoever named that moon evidently had a very good understanding of Hamlet - the newly discovered moon of Uranus was named "Ophelia."
Ophelia goes round and round Uranus, without end. "O, how the wheel becomes it."
POLONIUS (2.2.401)
The actors are come hither, my lord.
HAMLET
Buz, buz!
POLONIUS
Upon mine honour,--
HAMLET
Then came each actor on his ass,--
OPHELIA (4.5.199)
they say he made a good end,--