Shakespeare's "Sonnet 31" and Donne's "Holy Sonnet 10" both share the theme of death, and both pose a challenge to the idea that death is really the end of human life, but each poet approaches this concept quite differently.
In Shakespeare's "Sonnet 31," which falls within the "Fair Youth" sequence, the challenge to death is posed in the form of the subject, whose "bosom is endeared with all hearts" and in whom "reigns love, and all love's loving parts / And all those friends which I thought buried." The poet suggests that, although "many a holy and obsequious tear" has been brought to the poet's eye when his past loves have died, he now finds that all the things he had loved in those people he now finds reborn in the subject of the poem, his new love. There is a very funereal compliment paid in the line, "Thou art the grave where buried love doth live"—the poet's new love has, in his own way, returned to the poet the "trophies of . . . lovers gone."
Despite the occurrence of the word "religious" to describe love, this poem is not religious in our modern understanding of the phrase: rather, the poet says, death does not truly kill our virtues not because of any afterlife, but because we will always find again the parts of people we admired in someone else. As the poem concludes, "Their images I lov'd I view in thee, / And thou, all they, hast all the all of me."
Donne's "Holy Sonnet 10," on the other hand, is very much concerned with a religious challenge to the idea that death is really the end. Although similar in sonnet form to Shakespeare's poem, it does not share Shakespeare's suggestion that the traits of the dead live on in others, but rather that people cannot truly be killed at all—"nor yet canst thou kill me." Death, Donne says, is not "mighty and dreadful" as many fear, but in fact "slave to fate, chance, kings, and desperate men"—that is, Death is not in fact in charge of His own doings, but arrives at the behest of others wielding "poison, war, and sickness." Donne goes on to say that Death is really no different to sleep—"one short sleep past, we wake eternally, and death shall be no more." The poet is alluding here to the Christian belief in an afterlife: the personified "Death" "shalt die" because he has only the power, in the view of the poet, to put us to sleep for a short time, before we are reawakened to live forever with God.