After Brahms' successful Sextet No. 1 in B flat Major, Op. 18 was published in 1862, he embarked on a second in September 1864, which was completed the following May. It was published in 1866, and the first performance followed on February 3, 1867, in Vienna. Quieter and more reflective than the first sextet, the second did not achieve the immediate success enjoyed by its predecessor. During the composition of the Second Sextet, Brahms kept the work to himself. Brahms' relationship with Agathe von Siebold, a singer in Göttingen for whom he had composed the Lieder, Op. 14 and Op. 19, had reached a point of such intensity that both she and her friends assumed an engagement was imminent. Brahms was intent on continuing to see Siebold, although he did not wish to "wear fetters," as he put it in a letter to her. Siebold broke off the relationship, leaving Brahms despondent. The Sextet, Op. 36, is really dedicated to her. Three times near the end of the first-movement exposition the first and second violins, together, spell "Agathe" by playing the pitches A-G-A-D-H-E ("H" is the German designation for B natural). After the composition of the Sextet, Brahms noted to a friend, "Here I have freed myself from my last love."
The themes of all four movements are related. The first opens with a rising fifth that proceeds up a half step, only to leap up another fifth. The theme of the Adagio third movement follows the same pattern except the leaps are fourths separated by a whole step. The tremolo opening of the fourth movement includes leaps of fourths and fifths and movement by whole steps, while these same intervals permeate the ensuing thematic material. Leaps of fourths and fifths are buried in the accompaniment of the Scherzo, while the Trio theme features the original pattern in the opposite direction.
From the beginning, the ambivalent main theme of the Allegro ma non troppo first movement shifts between G major and E flat major, a repeated G - F sharp tremolo in the first viola providing the only anchor in the nebulous first 30 measures. The tremolo permeates the entire development section of the lengthy movement, the coda of which presents the main theme fully in G major, without the E flat inflections.
Instead of placing a slow movement second, Brahms follows the Allegro with a somewhat gloomy, minor mode Scherzo in 2/4 meter. A jocular central section, shifting to the major and a 3/4 meter, provides a foil to the mood of the Scherzo. The pensive Adagio, a set of five variations with a coda, contains some of the most dense contrapuntal layering of the sextet. The stormy finale is a combination of rondo and sonata forms. The opening six measures reappear several times on different harmonies, dominating the texture of the movement.