The garden motif in Shakespeare's play Hamlet is a recurring symbol that appears throughout the play and serves as a metaphor for the themes of decay, corruption, and rebirth.
One of the first instances of the garden motif appears in Act I, Scene 2, when Claudius, the new king of Denmark, compares his act of killing his brother (the old king, Hamlet's father) to the act of pruning a plant. He says, "O, my offence is rank, it smells to heaven; / It hath the primal eldest curse upon't, / A brother's murder. Pray can I not, / Though inclination be as sharp as will. / My stronger guilt defeats my strong intent, / And, like a man to double business bound, / I stand in pause where I shall first begin, / And both neglect." Here, Claudius is implying that his act of murder is like pruning a plant, in that it is a necessary evil in order to allow for new growth. However, this metaphor is flawed, as Claudius' act of murder is not a necessary evil, but rather an act of corruption and decay.
Another instance of the garden motif appears in Act II, Scene 2, when Polonius, the Lord Chamberlain, speaks to his son Laertes before Laertes leaves for France. Polonius advises Laertes to "neither a borrower nor a lender be," and to "be thou familiar, but by no means vulgar." He compares living a virtuous life to tending a garden, saying "To thine own self be true, / And it must follow, as the night the day, / Thou canst not then be false to any man. / Farewell. My blessing season this in thee!" Here, Polonius is using the metaphor of a garden to encourage Laertes to live a virtuous life, and to be true to himself. However, Polonius himself is not a virtuous man, as he later becomes involved in the plot to spy on Hamlet and ultimately meets his death at Hamlet's hand.
The garden motif also appears in Act III, Scene 4, when Hamlet speaks to his mother, Queen Gertrude, about the corrupt state of Denmark. He compares the kingdom to a diseased garden, saying "Something is rotten in the state of Denmark." This metaphor highlights the corruption and decay that has taken over the kingdom, with Claudius as the rotten plant at the center.
Finally, the garden motif appears in Act V, Scene 2, when Fortinbras, the Prince of Norway, arrives in Denmark and sees the aftermath of the events of the play. He compares the fallen bodies of the characters to a garden that has been destroyed, saying "So much was our life o'erthrown / So mighty and so many our dead, / That Fortinbras had himself the right, / As heir to the old king, to the crown." Here, the garden motif serves as a metaphor for the destructive power of the events of the play, and the way in which they have left the kingdom in a state of ruin.
Overall, the garden motif in Hamlet serves as a metaphor for the themes of decay, corruption, and rebirth that run throughout the play. It highlights the corrupt state of Denmark, and the way in which the characters are caught up in a cycle of destruction and renewal.