Der Geist hilft unser Schwachheit auf, BWV 226

 (The Spirit gives aid to our weakness), BWV 226, is a motet by Johann Sebastian Bach, composed in Leipzig in 1729 for the funeral of Johann Heinrich Ernesti.
History.
For ' , the autograph score survives. Bach himself noted on its title: "." (' – Motet for two choirs for the funeral for the blessed Rector, Professor Ernesti, by J. S. Bach). Ernesti was professor of poetry at Leipzig University and director of the Thomasschule. The first performance took place in the Paulinerkirche, the university church). Scholars debate if the performance was 24 October, or rather 21 October, as indicated by the title page of the sermon.
Bach wrote a number of works for occasions of Leipzig University. Twelve such works survive: they are mainly festive in character (in German they have been categorised as "Festmusiken zu Leipziger Universitätsfeiern"). 
As well as being part of a series of works connected with the university, "Der Geist hilft unser Schwachheit auf" as a funeral motet is one of a series of Bach motets. 
Text.
The text is taken from the Epistle to the Romans () and Martin Luther's third stanza to the hymn "" (1524). Ernesti himself had chosen the text from the epistle for the funeral sermon.
Scoring and structure.
The motet is structured in three movements and scored for two four-part choirs. They sing together in movements 2 and 3. The orchestral parts are extant, indicating that choir I was doubled by strings, choir II by reeds (two oboes, taille and bassoon). For the basso continuo, separate violone and organ parts are provided.
Music.
Bach composed the text according to its meaning, not as music for mourning. The opening contrasts two choirs in imitation. In lively 3/8 time, the word " (Spirit) is illustrated by a lively melismatic figure. The following idea, " (but the Spirit itself intercedes for), is given as a fugue, first with independent entrances of all eight parts, but concentrated to four parts in the end, "" (with unutterable sighs). The sighs are audible in the broken melodic lines of all voices. The thought "" (He, however, who examines hearts) appears as a double fugue in four parts in . Here the word "" (saints) is illustrated in extended melismatic writing. The closing Pentecostal chorale is set for four parts.