Sonata in B-flat major for piano four-hands, D 617 (Schubert)

The Sonata in B-flat major for piano four-hands, D 617 (Op. 30) by Franz Schubert, is the first of two sonatas for two pianists the composer wrote in his lifetime, the other being the Grand Duo of 1824.
History.
Schubert wrote this work in the summer of 1818 while at Zseliz on the Esterházy estate, probably for the two countesses he was tutoring at the time. It was one of a number of works for piano four-hands he composed while resident there.
The work was published in 1823 as the composer's Op. 30 with a dedication to Count Ferdinand Palffy d'Erdöd, proprietor of the Theater an der Wien. Max Harrison speculates that the dedication may have been connected with the performances of Rosamunde that took place there in the same year. 
Structure.
The work is in three movements: