I’m no expert on fairy tales but such stories as purveyors of folk and esoteric ideas interest me. So I found The Little Mermaid fascinating when I finally read the original a few years ago and was even more interested as I studied Western esotericism for context for my dissertation. All I know about Andersen comes from Wikipedia, but studying esotericism gave some interesting additional context, which relates to the Mormon doctrine of the importance of eternal marriage.
I hear lots of scorn cast at Disney’s version these days and Andersen’s original is obviously a very different story. The major difference being the little mermaid’s motivation for becoming human and trying to get the prince to love her.
“If men are not so unlucky to drown,” asked the little mermaid, “then do they live forever? Don’t they die as we do, down here in the sea?”
“Yes they do,” answered her grandmother. “Men must also die and their life span is shorter than ours. We can live until we are three hundred years old; but when we die, we become the foam on the ocean…. We do not have immortal souls. When we die, we shall never rise again…. But men have have souls that live eternally, even after their bodies have become dust. They rise high up into the clear sky where the stars are. As we rise up through the water to look at the world of man, they rise up to the unknown, the beautiful world, that we shall never see.”
“Why do I not have an immortal soul!” sighed the little mermaid unhappily. “I would give all my three hundred yeas of life for only one day as a human being if, afterward, I should be allowed to live in the heavenly world…. Can’t I do anything to win an immortal soul?”
“No,” said the old merwoman. “Only if a man should fall so much in love with you that you were dearer to him than his mother and father; and he cared so much for you that all his thoughts were of love for you; and he let a priest take his right hand and put it in yours, while he promised to be eternally true to you, then his soul would flow into your body an you would be able to partake of human happiness.”
Here Andersen was addressing a handful of Platonic/esoteric motifs. First the notion of eternal marriage. In Plato’s Symposium, Aristophanes tell the myth of the androgyne: that humans were once male/female wholes that were split and that now we seek out other half to become whole. In the Phaedrus, Socrates says that humans, who used to live with the gods in a premortal state, can ascend back to the gods (regrow their wings) through loving another person (Phaedrus 255-56).
Another motif seems to be based on the Abbe de Villars’s popular The Count of Gabalis (1670) which, in order to mock spirit invokers, told the fictitious and satirical story of a young man who is instructed by the count about “the people of the Elements”: Sylphs, Gnomes, Nyphms, and Salamanders. Of Salamander women, the count explains,
“The beauty of their intellects will charm you more than that of their bodies, yet one cannot help pitying these unfortunates when they tell one that their souls are mortal, and that they have no hope whatever of eternal enjoyment of the Supreme Being, of Whom they have knowledge and Whom they worship reverently…. They die only after several centuries; but what is time in comparison with eternity? They must return for ever into nothingness. This thought grieves them deeply, and we have utmost difficulty in consoling them.
“Our Fathers, the Philosophers, when speaking with God face to face, complained to Him of the unhappiness of these Peoples, and God, whose mercy is boundless, revealed to them that it was not impossible to find a remedy for this evil. He inspired them to the realization that just as man, by the alliance which he has contracted with God, has been a participant in Divinity; so the Sylphs, Gnomes, Nymphs, and Salamanders, by the alliance which they have in it their power to contract with man, can become participants in immortality. Thus a Nymph or a Symphid becomes immortal and capable of the Beatitude to which we aspire when she is so happy to marry a Sage; and a Gnome or a Sylph ceases to be mortal the moment he espouses one of our daughters.” 
Reading Wikipedia’s entry on both the story and Andersen suggests that the story was autobiographical. “Most of what I have written is a reflection of myself,” Andersen once wrote. Wikipedia says that Anderson wrote the story at the time a male love interest, Edvard Colvin, was getting married, “I languish for you as for a pretty Calabrian wench… my sentiments for you are those of a woman. The femininity of my nature and our friendship must remain a mystery.” Wikipedia says, “Collin, who preferred women, wrote in his own memoir: “I found myself unable to respond to this love, and this caused the author much suffering.’ Likewise, the infatuations of the author for the Danish dancer Harald Scharff, and Carl Alexander, the young hereditary duke of Saxe-Weimar-Eisenach, did not result in any relationships.” Andersen also had interest in women and proposed to one Jenny Lind.  Yet says Wikipedia, “Her feelings towards him were not the same; she saw him as a brother, writing to him in 1844 ‘farewell… God bless and protect my brother is the sincere wish of his affectionate sister, Jenny.'” The little mermaid develops a similar relationship with the prince. “Day by day the prince grew fonder and fonder of her; but he loved her as he would have loved a good child, and had no thought of making her his queen. And she had to become his wife for she would never have an immortal soul, but on the morning after his marriage would become the foam on the great ocean.”
Says Wikipedia, “At one point, he wrote in his diary: ‘Almighty God, thee only have I; thou steerest my fate, I must give myself up to thee! Give me a livelihood! Give me a bride! My blood wants love, as my heart does!'” Yet like Andersen, the little mermaid could not find love and Andersen’s original version ends with, “She threw herself into the sea and felt her body changing into foam.”
Yet, Andersen later added another ending to the story:
But the little mermaid did not feel death, she saw the sun, and up above her floated hundreds of airy, transparent forms….
“Where am I?” she asked….
“We are the daughters of the air,” they answered. “Mermaids have no immortal soul and can never have one, unless they can obtain love of a human being. Their chance of obtaining eternal life depends upon others. We, daughters of the air, have not received an eternal soul either; but we can win one by good deeds…. If for three hundred years we earnestly try to do what is good, we obtain an immortal soul and can take part in the eternal happiness of man. You, little mermaid, have tried with all your heart to do the same. You have suffered and borne your suffering bravely; and that is why your are now among us, the spirits of the air. Do your good deeds and in three hundred years an immortal soul will be yours.”
Though as a straight married man, I probably don’t relate to these themes as I might otherwise, I still find this ending to be quite lovely. I know that many like Andersen don’t find the love they seek in this life and I know we Mormons have messages of hope, but I particularly like the way that The Little Mermaid presents the situation. Those who “have tried with all their heart” will gain the blessing.
 Abbe de Villars, Comte de Gabalis (1670, reprint; New York: Brothers, 1902), 33-35.
 I wonder if Andersen who was apparently gay, made attempts to play straight to find female love. I wonder if the part of the story where the little mermaid goes to see the sea witch and has her tongue cut out and is given legs that feel like knives stabbing her with ever step was a description of the attempt to be straight.