"If I Only Had a Brain" has music by Harold Arlen and lyrics by Yip Harburg, and was published in 1939 for the MGM film The Wizard of Oz. In the film, the Scarecrow, played by Ray Bolger, sings it as he longs for a brain. The Tin Man and the Cowardly Lion later sing its variants "If I Only Had a Heart" and "If I Only Had the Nerve". The melody was first written for the 1937 Broadway musical Hooray for What! as "I'm Hanging On To You", where it was dropped; Harburg then wrote new lyrics for the film. The tune is a syncopated schottische in the style of vaudeville soft-shoe and sand-dance numbers.
Bolger's first recording was more sedate than the film version and was later re-recorded. The original was thought lost for over seven decades and was rediscovered in 2009. The film number included a Busby Berkeley-style dance, cut for length, which was used in the 1985 film That's Dancing! and as a 1999 DVD extra. The earliest recording is by Victor Young and His Orchestra, 1939, with vocals under Ken Darby, on the soundtrack album The Wizard of Oz. The 2011 stage musical kept the song and added the reprise "If We Only Had a Plan". The song is a standard, covered by Harry Connick Jr., Michael Feinstein, Robbie Williams and The Flaming Lips.