The term for a poem or song that expresses grief or mourning for someone who has died is an "elegy."
An elegy is a form of lyrical poetry that reflects on loss, sorrow, and the passing of someone or something dear. It provides a means for the poet to express their emotions, pay tribute to the deceased, and explore themes of mortality and transience. Elegies often convey a sense of mourning, longing, and reflection, capturing the poet's personal grief or offering a collective lament.
Traditionally, elegies were written in a specific poetic form with a solemn and melancholic tone. However, contemporary elegies can take various forms and styles, adapting to the changing conventions of poetry. Elegies can be dedicated to individuals, groups, or even broader subjects like the loss of innocence or the decline of an era.
Famous examples of elegies include "Elegy Written in a Country Churchyard" by Thomas Gray, "In Memoriam A.H.H." by Alfred, Lord Tennyson, and "O Captain! My Captain!" by Walt Whitman. Elegies hold a significant place in literature, providing a means for writers to confront mortality, express grief, and commemorate the departed.