According to biographers of McCartney and The Beatles, McCartney composed the entire melody in a dream one night in his room at the Wimpole Street home of his then girlfriend Jane Asher and her family. Upon waking, he hurried to a piano and played the tune to avoid forgetting it.
McCartney's initial concern was that he had subconsciously plagiarised someone else's work (known as cryptomnesia). As he put it, "For about a month I went round to people in the music business and asked them whether they had ever heard it before. Eventually it became like handing something in to the police. I thought if no-one claimed it after a few weeks then I could have it."
Upon being convinced that he had not robbed anyone of his melody, McCartney began writing lyrics to suit it. As Lennon and McCartney were known to do at the time, a substitute working lyric, entitled "Scrambled Eggs"(the working opening verse was "Scrambled Eggs/Oh, my baby how I love your legs"), was used for the song until something more suitable was written. In his biography, Paul McCartney: Many Years from Now, McCartney recalled: "So first of all I checked this melody out, and people said to me, 'No, it's lovely, and I'm sure it's all yours.' It took me a little while to allow myself to claim it, but then like a prospector I finally staked my claim; stuck a little sign on it and said, 'Okay, it's mine!' It had no words. I used to call it 'Scrambled Eggs'."
During the shooting of Help!, a piano was placed on one of the stages where filming was being conducted and McCartney would take advantage of this opportunity to tinker with the song. Richard Lester, the director, was eventually greatly annoyed by this and lost his temper, telling McCartney to finish writing the song or he would have the piano removed. The patience of the other Beatles was also tested by McCartney's work in progress, George Harrison summing this up when he said: "Blimey, he's always talking about that song . You'd think he was Beethoven or somebody!"
Lennon later indicated that the song had been around for a while before: "The song was around for months and months before we finally completed it. Every time we got together to write songs for a recording session, this one would come up. We almost had it finished. Paul wrote nearly all of it, but we just couldn't find the right title. We called it 'Scrambled Eggs' and it became a joke between us. We made up our minds that only a one-word title would suit, we just couldn't find the right one. Then one morning Paul woke up and the song and the title were both there, completed. I was sorry in a way, we'd had so many laughs about it."
Art credit: Fried Eggs by Francesca Nobile. Glue and acrylic on canvas.