"If I Only Had a Brain" (also "If I Only Had a Heart" and "If I Only Had the Nerve") is a song by Harold Arlen (music) and E.Y. Harburg (lyrics). The song is sung in the 1939 film The Wizard of Oz by the characters that meet Dorothy. The characters pine about what each wants from the Wizard. It was also sung in Jeremy Sams and Andrew Lloyd Webber's 2011 musical adaptation with an additional reprise called "If We Only Had a Plan" when the characters discuss on how to rescue Dorothy in Act II.
Originally written by Arlen and Harburg as "I'm Hanging On To You" for the 1937 Broadway musical Hooray for What!, the song was ultimately dropped from that show, and when the pair was later hired to do the songs for Oz, Harburg simply wrote new lyrics to the tune.
The Scarecrow's version of the song is sung about getting a brain. The original recording included an extravagant Busby Berkeley-choreographed dance routine, but this was eventually cut for length reasons. A closing vocal stanza was likewise cut. Both pieces still exist and are available for viewing.
In the film as officially released, he sings the first and second verses of this song, then falls over comically. In the original cut as well as the 1985 film That's Dancing!, though, he sings the first and second verses, begins to dance, and eventually a crow takes a large portion of his straw. The scarecrow then flies in the air to get it back, which he does. Then, he does some splits (forward and backward), and then a pumpkin rolls down the road. When it goes through the scarecrow's legs, he is thrown high into the air. Now, he comes down, bounces against the fences, sings a third verse of this song, then falls down.
That sequence was eventually used as a segment in the 1985 film That's Dancing!, and Warner Bros. considered restoring it for Oz's 1998 theatrical re-release, but decided against it. The sequence is included as a DVD extra on the 1999, 2005, and 2009 releases.