The FEEL star collaborated with Zimmer to write the track A MAN FOR ALL SEASONS for film, which stars Mr Bean actor Rowan Atkinson and Australian babe Natalie Imbruglia, with whom the Brit singer had a brief fling.
Williams's inclusion on the film soundtrack could help boost his profile in America, where so far he's struggling to make an impact.
He penned the lyrics, while Zimmer - who scored Gladiator and won an ACADEMY AWARD for THE LION KING - came up with the music.
The film's music supervisor, NICK ANGEL, says, "Robbie was particularly excited about writing a theme song about the character in the movie rather than a song whose lyrics have little relevance to the film in question.
"The collaboration between Robbie and Hans was highly successful."