"(Tilfreds i sit hjerte og glad i sit sind)" [Danish title] is number 2121 in the Hans Christian Andersen Center's register of Andersen's literary works, i.e. no. 621 in the category poems (the range 1501 - 2900). BFN 707.
"(Tilfreds i sit hjerte og glad i sit sind)" [Danish title] was first published 19 December 1854. Further information: Digterens danske Værker 1822-1875 number 707.
The work was published as a part of Samlede Skrifter af H. C. Andersen. - Sextende Bind [Danish title]. (Number 1018. BFN 676. Category/genre: Collected and miscellaneous writings).
In modern Danish on p. 530 in Johan de Mylius (editor): H.C. Andersen. Samlede digte ('Collected poems', Copenhagen, 2000).