'Just read The Tempest!' Beethoven allegedly told his sometime secretary Anton Schindler, in reply to a request to provide the key to Sonata No. 17. This connection with one of Shakespeare's last plays was the source of the Sonata's nickname. But the problem with this story is twofold: first, in Schindler's account, Beethoven's reply applied to both Sonata No. 17 and Sonata No. 23. The latter, by the time of the story's publication, already had a nickname - Appassionata - and so the Tempest nickname only stuck to the sonata that was still unnamed. Secondly, today we know that Schindler was a forger and a fabricator - many of his entries in the written conversation books with Beethoven were inserted by him long after Beethoven's death (as shown by research in the 1970s and '80s), and thus it is impossible to say whether any reply which he had attributed to Beethoven was true or falsified.
In the end, perhaps it doesn't matter. The nickname wouldn't have held, had listeners and performers not felt it reflected some true part of the music's core. Whether or not we link it to the play, the opening of the Sonata is breathtakingly strong. With one simple broken chord, Beethoven creates so much atmosphere and promises so much magic that the music transports us elsewhere right away. This is also Beethoven's own magic: to take something as commonplace as a chord used to signal the beginning of a recitativo in opera all throughout the 18th century, and to transform it into a work of art simply by slowing it down and bringing its dynamic down to pianissimo.
https://beethoven32.com/