The piano sonatas began to be composed after the invention of the piano in the early 1700s. Important piano sonatas of this period were written by Haydn and Mozart, among other composers.
In the Romantic Era of the early to late 1800s the Sonata changed in that the final movement started to end with a scherzo, rather than a rondo. Famous compositions in this period include the "Moonlight" Sonata in C sharp minor by Beethoven and the "Funeral March" sonata in B flat minor by Chopin.
Piano sonatas continued to be written in the modern period by composers such as Serge Prokofiev, Charles Ives and Lukas Foss.
Much of the typical features of the sonata are not used in modern sonatas, which can be seen in the sonatas of Barraque and Boulez. They lack any connection in form or genre with any previous sonatas, according to the "Grove Dictionary of Music."
A modern example of the piano sonata that breaks tradition is the piano sonata by Leonard Bernstein written in 1938. It has only 2 movements, the second having 3 tempo markings: Largo, Moderato and Cadenza.