This folktale has been contested ever since antiquity, especially by Pliny the Elder, 77AD, in his masterpiece refuted it in Natural History, where he concluded: Olorum morte narratur flebilis cantus, falso, ut arbitror, aliquot experimentis, Observation shows that the story that the dying swan sings is false.
But the folktale has remained so appealing that over the centuries it has continued to appear in various artistic works.
The fable of Aesop - The Swan Mistaken for a Goose, exploits this folktale: The swan, who had been caught by mistake instead of the goose, began to sing as a prelude to its own demise. His voice was recognized and the song saved his life.
Ovid mentions it in The Story of Picus and Canens: There, she poured out her words of grief, tearfully, in faint tones, in harmony with sadness, just as the swan sings once, in dying, its own funeral song.
Orlando Gibbons’s famous madrigal - The Silver Swan states the legend, too:
The silver Swan, who living had no Note,
when Death approached, unlocked her silent throat.
Leaning her breast against the reedy shore,
thus sang her first and last, and sang no more:
Farewell, all joys! O Death, come close mine eyes!
More Geese than Swans now live, more Fools than Wise.
In Shakespeare's The Merchant of Venice, Portia exclaims:
Let music sound while he doth make his choice;
Then, if he loses, he makes a swan-like end,
Fading in music.
The expression is used when you are referring to a final theatrical or dramatic appearance, or any final work or accomplishment. The connotation is that the performer is aware that this is the last performance of his or her lifetime, and is expending everything in one magnificent final effort.