The shift of tone from solemnity to comedy has puzzled commentators on the play. One theory is that the later part of the scene is a survival from an earlier version of Hamlet, the so-called Ur-Hamlet. Commenting on the Latin phrase “hic et ubique” (here and everywhere), Silberschlag wrote:
Wie wir bereits bemerkt haben, daß diese Scene großentheils wörtlich aus dem früheren Entwurfe des Stüds, vielleicht schon aus dem Drama von Shakespeares Vorgänger, beibehalten ist. Hiefür spricht namentlich auch die lateinische Floskel „hic et ubique“ […] Die dramatischen Vorgänger Shakespeares liebten es, derartige lateinische Floskeln in ihre Stücke einzumischen, Shakespeare huldigt aber dieser Sitte nur in seinen frühesten Dichtungen, nicht in den späteren Werken. Wir möchten daher schon aus dem Gebrauche diefer Floskel schlißen, daß Shakespeare den ganzen Schluß der Scene aus dem früheren Stücke beibehalten hat, vielleicht aus keinem andern Grunde, als weil das Publikum diese Scene einmal lieb gewonnen hatte.
It is highly probable the conclusion of this scene is a remnant, word for word, of the earlier tragedy by Shakespeare’s predecessor.† The Latin phrase “hic et ubique” also upholds this view. The dramatic predecessors of Shakespeare were very fond of interlarding their pieces with such little snatches of Latin, and Shakespeare yielded to the practice only in his very earliest plays, not in his later ones. Therefore, from the use of these little phrases alone we might infer that Shakespeare retained all of these concluding lines from the earlier drama, perhaps from no other reason than that the scene had become a popular favourite.
Carl Silberschlag (1860). ‘Shakespeares Hamlet’. In Morgenblatt für gebildete Leser 1860:47, p. 1113. English translation adapated from Horace Howard Furness, ed. (1918). A New Variorum Edition of Shakespeare: Hamlet, volume I, pp. 114–115. Philadelphia: Lippincott.
† The modern Ur-Hamlet theory includes the possibility, not considered by Silberschlag here, that the earlier play was also by Shakespeare.
However, Coleridge defended the tonal shift on dramatic grounds:
This part of the scene after Hamlet’s interview with the Ghost has been charged with an improbable eccentricity. But the truth is, that after the mind has been stretched beyond its usual pitch and tone, it must either sink into exhaustion and inanity, or seek relief by change. It is thus, well known that persons conversant in deeds of cruelty, contrive to escape from conscience, by connecting something of the ludicrous with them, and by inventing grotesque terms and a certain technical phraseology to disguise the horror of their practices. Indeed, paradoxical as it may appear, the terrible by a law of the human mind always touches on the verge of the ludicrous. Both arise from the perception of something out of the common order of things—something, in fact, out of its place; and if from this we can abstract danger, the uncommonness will alone remain, and the sense of the ridiculous be excited. The close alliance of these opposites—they are not contraries—appears from the circumstance, that laughter is equally the expression of extreme anguish and horror as of joy: as there are tears of sorrow and tears of joy, so is there a laugh of terror and a laugh of merriment. These complex causes will naturally have produced in Hamlet the disposition to escape from his own feelings of the overwhelming and supernatural by a wild transition to the ludicrous,—a sort of cunning bravado, bordering on the flights of delirium. For you may, perhaps, observe that Hamlet’s wildness is but half false; he plays that subtle trick of pretending to act only when he is very near really being what he acts.
The subterraneous speeches of the Ghost are hardly defensible:—but I would call your attention to the characteristic difference between this Ghost, as a superstition connected with the most mysterious truths of revealed religion,—and Shakspeare’s consequent reverence in his treatment of it,—and the foul earthly witcheries and wild language in Macbeth.
Samuel Taylor Coleridge. ‘Notes on Hamlet’. In Henry Nelson Coleridge, ed. (1836). The Literary Remains of Samuel Taylor Coleridge, volume II, pp. 221–222. London: William Pickering.
The effect described by Coleridge is somewhat similar to that in Macbeth, where the murder of Duncan in II.2 is immediately followed by the comic business of the drunken porter in II.3.