Simply put, William Shakespeare's The Tempest includes aspects of both tragedy and comedy. Generally considered Shakespeare's final play (believed to be written around 1610), it is considered the last of his late romance plays. Highly theatrical--better viewed on stage than through reading--The Tempest includes the tragic element of the treacherous death plans followed by Prospero's revenge in addition to the many comic moments; including the love interests of Miranda and Ferdinand, the trickster Ariel, and the monstrous Caliban. The comic moments far outweigh the tragic elements, making it one of Shakespeare's most enjoyable and sometimes incongruous plays.
At the time of the Renaissance, a tragicomedy came to be defined as a type of work that does not quite fit with either a tragedy or a comedy.
A tragedy is basically a serious story which often involves the death of one or more of the characters. A comedy is a lighthearted, funny story that has a happy ending. A tragicomedy is not lighthearted enough to be called a comedy and it doesn't include death and awful events to be called a tragedy.
Shakespeare's Tempest is a tragicomedy because although the story starts out in a serious tone and difficult situations and fears abound, there is no death and destruction. There are funny moments throughout the play as the characters on the island have interesting experiences. There is also a background of tragedy, about the ill-treatment received by Prospero and his daughter. But death itself doesn't come up on any of the characters in the play and there is a happy end. Everyone is content and they celebrate the love and forthcoming marriage of Miranda and Ferdinand, the king's son.
According to the Greek philosopher Aristotle, a play was a tragedy if everyone suffered in the end, even the innocent. A play was a comedy if the innocent triumphed and only the wicked came to a horrible end. Comedies weren't necessarily humorous. But during the Renaissance, the genre of tragicomedy became more accepted. In this genre, the ending was happy but solemn topics of danger, fall from position, and important public figures or events were dealt with. Comedy as we think of comedy, with jokes and buffoonish characters, was also part of tragicomedy.
Looking at tragicomedy through this lens, we can see it applies to Shakespeare's The Tempest perfectly. Serious issues normally portrayed in tragedies are present, including Prospero's fall from power, the low sub-human villain of Caliban, the murder plot of Sebastian and Antonio against Alonso, and the theme of revenge. On the other hand, we have a romance between Miranda and Ferdinand, a humorous subplot with the lower-class Stephano and Trinculo, and the lighter elements of the bridal masque and other harmless magic. Ultimately when Prospero draws those who have wronged him into his magic circle, the play hangs in the balance between comedy and tragedy: Will he take revenge on those who have wronged him, showing himself to be no better than they, or will he overcome his desires for retribution and heed his higher nature? When he forgives those who wronged him and dons his ducal robes, order is restored, and the happy ending for everyone ensues, confirming the play to be a perfect example of tragicomedy.