 Mikkel Storleer Eriksen and Tor Erik Hermansen , together under the stage name Stargate , wrote and produced the song with additional writing by Amanda Ghost , Ian Dench and Makeba Riddick . The song was written in Bangladesh , Patchwerk and Silent Sound Studios in Atlanta , Georgia in 2008 . Knowles worked with Amanda Ghost to re @-@ write Franz Schubert 's " Ave Maria " after having co @-@ written " Disappear " in London . She stated that the song was one of the most personal on the album . Ghost told The Daily Telegraph that Knowles ' references to rapper Jay @-@ Z are usually unclear and open to interpretation , yet her music , including " Ave Maria " , " is the one place she can be incredibly expressive " . Knowles and Ghost both liked Schubert 's song and walked down the aisle to the song during their respective weddings . The marriages of the artists inspired them to write their own version of the recording . She further discussed the lyrics and inspiration : 
