For such a major component of the play (not to mention a topic that has been examined so often), I didn't realize 'melancholy' was only used twice in the play. Although it was published about two decades after Hamlet was first performed, I thought Robert Burton's The Anatomy of Melancholy would provide some additional insight on the thinking of the ailment at the time. Burton discusses the defining cause, an excess of the black bile humour, but also looks at additional causes. Some of the additional causes that are relevant to the play are solitude, death of a close friend or relative, anguish, or supernatural events. Underlying any cause of melancholy, though, is sorrow,
"the mother and daughter of melancholy, her epitome, symptom, and chief cause"; as Hippocrates hath it, they beget one another, and tread in a ring, for sorrow is both cause and symptom of the disease. (259)
But what is the relationship between melancholy and madness? In the play Hamlet's pretend madness consumes him the longer he acts that way. If not driven to the state of madness by the end of the play he certainly seems to be in the same zip code. Burton investigates how melancholy intertwines with madness, defining the latter as follows:
Madness is therefore defined to be a vehement dotage, or raving without a fever, far more violent than melancholy, full of anger and clamour, horrible looks, actions, gestures, troubling the patients with far greater vehemency both of body and mind, without all fear and sorrow, with such impetuous force and boldness that sometimes three or four men cannot hold them. Differing only in this from frenzy, that it is without a fever, and their memory is most part better. (140)
If violence was seen as the bridge between melancholy and madness, does this become another reason Hamlet hesitates to revenge his father? Horatio's warning that following the ghost will lead to Hamlet's madness takes on additional meaning in this context beyond the superficial meaning of "follow." Does Hamlet hesitate, in part, because he believes violence will transform his melancholy into madness? Does this understanding of madness provide one reason Polonius suspects there is some method behind Hamlet's actions since the prince hasn't been violent? If this relationship was generally accepted in Shakespeare's time, then Hamlet's shift to action in the final scene confirms that he really is mad. I don't recall any specific mentions of this relationship in the play, but it will be something I'll look for during the next re-reading.
Note: All page numbers refer to the following edition:
Burton, R., & Jackson, H. (2001). The Anatomy of Melancholy. New York: New York Review of Books.