Longfellow wrote the poem shortly after completing lectures on German writer Johann Wolfgang von Goethe and was heavily inspired by him. He was also inspired to write it by a heartfelt conversation he had with friend and fellow professor at Harvard University Cornelius Conway Felton; the two had spent an evening "talking of matters, which lie near one's soul:–and how to bear one's self doughtily in Life's battle: and make the best of things".[2] The next day, he wrote "A Psalm of Life". Longfellow was further inspired by the death of his first wife, Mary Storer Potter,[3] and attempted to convince himself to have "a heart for any fate".[1]
The poem was first published in the October 1838 issue of The Knickerbocker,[1] though it was attributed only to "L." Longfellow was promised five dollars for its publication, though he never received payment.[4] This original publication also included a slightly altered quote from Richard Crashaw as an epigram: "Life that shall send / A challenge to its end, / And when it comes, say, 'Welcome, friend.'"[5] "A Psalm of Life" and other early poems by Longfellow, including "The Village Blacksmith" and "The Wreck of the Hesperus", were collected and published as Voices of the Night in 1839.[6] This volume sold for 75 cents[7] and, by 1842, had gone into six editions.[8]
In the summer of 1838, Longfellow wrote "The Light of Stars", a poem which he called "A Second Psalm of Life".[9] His 1839 poem inspired by the death of his wife, "Footsteps of Angels", was similarly referred to as "Voices of the Night: A Third Psalm of Life".[10] Another poem published in Voices of the Night titled "The Reaper and the Flowers" was originally subtitled "A Psalm of Death".[11]