The trio sonata is a musical form that was popular in the 17th and early 18th centuries.
A trio sonata is written for two solo melodic instruments and basso continuo, making three parts in all, hence the name trio sonata. However, because the basso continuo is usually made up of at least two instruments (typically a cello or bass viol and a keyboard instrument such as the harpsichord), performances of trio sonatas typically involve at least four musicians, and some 18th-century published editions have duplicate partbooks for the bass (Mangsen 2001). The trio sonatas by Arcangelo Corelli (opus 1, 1681, opus 3, 1689) were of unparalleled influence during his lifetime and for a long time after, inspiring slavish imitation by composers whose numbers were legion (Talbot 2001).
The melody instruments used are often both violins. A well-known exception is the trio sonata in Johann Sebastian Bach's The Musical Offering, which is for violin and flute.
Johann Sebastian Bach's trio sonatas for organ (BWV 525–530) combine all three parts on one instrument. Typically the right hand, left hand and pedals will each take a different part thus creating the same texture as in a trio. A further innovation by Bach was the trio sonatas involving a concertante (obbligato) right-hand harpsichord part in addition to the bass line, plus one melodic instrument, thus for two players. Examples are the six sonatas for harpsichord and solo violin (BWV 1014–1019), three sonatas for harpsichord and viola da gamba (BWV 1027–1029), and three sonatas for harpsichord and flute (BWV 1030–1032)
Read more about Trio Sonata: Example Repertoire, Literature