Jeremy Irons and Dev Patel play the numbers game in biographical drama The Man Who Knew Infinity

Film tells the story of a poor Indian man, Srinivasa Ramanujan, who went to Cambridge and was a mathematics genius, and his friendship with his mentor GH Hardy.

Dev Patel in The Man Who Knew Infinity. Courtesy IFC Films
Powered by automated translation

While the First World War raged, a poor boy from a religious family in India went to Cambridge University and stunned the world with his mathematical equations. Srinivasa Ramanujan, one of the most remarkable prodigies in history, is the focus of The Man Who Knew Infinity, a biographical drama based on the book by Robert Kanigel.

At university, Ramanujan had to overcome racism and the doubts of his mentor, the renowned scholar G H Hardy, and it is their friendship that filmmaker Matthew Brown dwells on.

Slumdog Millionaire star Dev Patel portrays Ramanujan, while veteran actor Jeremy Irons takes on the role of Hardy. Stephen Fry, Toby Jones and Jeremy Northam round out the stellar cast as fellow academics.

Before the script landed on his desk, Patel admits that he didn’t know much about Ramanujan.

"I didn't realise I'd already heard of him," says the 26-year-old. "One of my favourite films is Good Will Hunting and there they talk about this Indian mathematician who created the most amazing theories. I thought: 'Oh, that guy sounds interesting,' and then I didn't hear about him again – I didn't even know his name." Now, though, Patel is quite familiar with Ramanujan's contributions to number theory, continued fractions, mathematical analysis and infinite theory.

Ramanujan, who was plagued with illnesses – including tuberculosis – all his life, died in 1920 at the age of 32 after returning to India.

Twenty years later, Hardy published A Mathematician's Apology, an essay that is considered one of the best insights into the mind of a mathematician, which includes a tribute to Ramanujan. In researching Hardy, Irons "discovered that mathematics could be as exciting as art and literature. It wasn't just one plus one equals two. It was more than that. It was a language, a dream, an adventure – it was everything that I try to fill my life with".

Fry plays Sir Francis Spring, the engineer who played a pivotal role in the construction of railways in East India. The erudite Fry read English literature at Cambridge and it was there that he first came across Hardy.

"I read A Mathematician's Apology while at university and I felt it was one of the most inspiring books I have ever read," he says. "It was a very simple book about finding mathematical genius without using any formulas or numbers on the pages. It also had this wonderful way of describing this intellectual and spiritual love affair – I think that is the only way to describe it – between two people from such different castes."

Fry loved the book so much that for years he tried to turn it into a film.

“I actually was writing a script, or trying to write a script on the novelised version, but I couldn’t make it work. Then I was approached by Matt Brown and his team and thought that they had a much better idea, so I was glad to have a small part.”

Brown wanted the film to reflect Kanigel’s book, which told the story from Ramanujan’s perspective. “I first came across Kanigel’s biography about 10 years ago and I fell in love with the personal story between Hardy and Ramanujan. The story of genius is fascinating as well, but it was really the personal story.”

The developing relationship between unlikely friends also happened off screen.

“Hardy does not know Ramanujan and Dev came as a surprise to me,” says Irons. “You always learn from other good actors and he is a nice guy. We finished the film remarkably friendly with each other, which is always a surprise.”

Ironically, one thing the two men profess to have in common is an inability to do ­mathematics.

“I know practically nothing about anything,” says Irons. Patel is no different. “My dad is an accountant, so I’m quite a let-down on that front. That was probably my worst subject,” says the actor, who had to go against his nature to play the mathematical genius.

“The difficult thing is that there is no real stock footage or any recordings of his voice, so the idea of mimicry goes out of the window straightaway. Kanigel’s book was great so that was a blueprint for us. “Ramanujan is a fish out of water, a man with a quiet nobility about him; he had a quiet intensity. Me, I’m quite hyperactive and fidgety.”

Irons says he wanted to make the film because he believes that cleverness should be celebrated.

“I think wisdom is attractive. We are surrounded by images that are of beauty and people that are famous because they are beautiful. Personally, I get extremely bored by that. When I meet someone who has real wisdom, it’s very rare, and for me that is the most attractive quality. I pray for these people, because the world depends on these people to move forward. It does not depend on beauty.”

The Man Who Knew Infinity is in cinemas now

artslife@thenational.ae