In dich hab ich gehoffet, Herr

"In dich hab ich gehoffet, Herr" ("In Thee, Lord, have I put my trust", literally: "In thee have I hoped, Lord") is a Lutheran hymn in seven stanzas, written by Adam Reusner and first published in 1533. He paraphrased the beginning of Psalm 31. It was first sung to the melody of a Passion hymn. The melody connected with the hymn in 1560 was derived from models dating back to the 14th century. A third melody from 1608 became a hymn tune for several other songs and translations to English. In the German Protestant hymnal Evangelisches Gesangbuch, the hymn appears as EG 257 with the second melody. Johann Sebastian Bach used the second and third melodies in chorale preludes, and the third also in cantatas and the St Matthew Passion.

English versions include a translation by Catherine Winkworth, "In Thee, Lord, have I put my trust".

History
Adam Reusner, who had studied in Wittenberg, wrote "In dich hab ich gehoffet, Herr" as a paraphrase of the first six verses of Psalm 31 following the tradition of Martin Luther's psalm songs (Psalmlieder). Like Luther, and unlike Reformed theologians such as Ambrosius Lobwasser and later Matthias Jorissen who followed the tradition of the Genevan Psalter, Reusner expanded the psalm verses. He developed a stanza of six lines for each of the first six verses of the psalm, and added a seventh stanza with a doxology.

The hymn first appeared in Augsburg in 1533, designated to be sung to the melody of the Passion hymn "Da Jesus an dem Kreuze stund". The hymn was translated into English in several versions, including Catherine Winkworth's "In Thee, Lord, have I put my trust", which has appeared in more than ten hymnals. "In dich hab ich gehoffet, Herr" is part of the current German Protestant hymnal Evangelisches Gesangbuch under number EG 257.

Form and text
Reusner formed stanzas of six lines for each of the first six verses of the psalm, and added a seventh stanza with a doxology. The six lines of each stanza rhyme AABCCB, with the fourth and fifth lines shorter at only four syllables.

The hymn follows the psalm as a confession of trust and hope in God, who is compared to a fortress, rock and shield when confronted with distress and enemies. In the liturgical tradition, every psalm is concluded by a Gloria Patri doxology, which Reusner also paraphrased.

Hymn texts and models
In the following table, the first column has Reusner's text taken from EG 275, the second column the texts from which he derived them, the psalm verses in the King James Version and the doxology for the seventh stanza, and finally the third column Winkworth's translation. EG 275 was modernised compared to the original at the end of the fourth stanza and the beginning of the seventh stanza.

Melodies and musical settings
In the first publication in 1533 and still in his 1554 hymnal, Reusner designated the melody to be the Passion song "Da Jesus an dem Kreuze stund". This hymn and the melody (Zahn 1706) first appeared around 1495.

In Martin Bucer's Strasbourg hymnal of 1560, the text appears with a second melody (Zahn 2459), which was derived from late-medieval models. It is in Dorian mode and features lively rhythms and large intervals, which suggest confidence. This is the melody of the hymn in the current Protestant hymnal. Further melodies appeared, especially a third melody which Sethus Calvisius composed in 1581 for the hymn.(Zahn 2461c). The hymn "Mein schönste Zier und Kleinod" is also sung to this tune. Further melodies (Zahn 2460b–2465) appeared in hymnals between 1557 and 1634.

Johann Sebastian Bach used the second melody for a chorale prelude in his Orgelbüchlein, as BWV 640. He used the third melody more frequently: with the original text of the seventh stanza in the early funeral cantata Gottes Zeit ist die allerbeste Zeit, BWV 106 (Actus tragicus), with the text of the first stanza as the closing chorale of cantata Falsche Welt, dir trau ich nicht, BWV 52, and with the text of the fifth stanza, "Mir hat die Welt trüglich gericht'" in the St Matthew Passion. He used the same melody in the chorale prelude BWV 712.

Bach wrote a setting of the same tune, with text from "Nun, liebe Seel, nun ist es Zeit", as a chorale in Part V of his Christmas Oratorio.

Several hymns are sung to the various tunes. The third melody is also used for "Nun liebe Seel, nun ist es Zeit". A variant of this tune became known as the hymn tune "In dich hab ich gehoffet, Herr", which serves as the melody of Winkworth's translation, "In Thee, Lord, have I put my trust", "My fairest crown, beyond all price" as a translation of "Mein schönste Zier", and "In you, Lord, I have found my peace", a shorter translation of Reusner's hymn.