Hey Jude
The ballad began as "Hey Jules", a song Paul McCartney wrote to comfort John Lennon's young son Julian after Lennon left his wife Cynthia for Yoko Ono. Wikipedia also notes a later performance that underlined the song's theme of optimism and togetherness, with the studio audience joining in on the long ending.
Source: Hey Jude (opens in a new tab).