Playing Stephen Hawking is a complex equation for Eddie Redmayne

Time is relative, especially for young actors tasked with playing brilliant theoretical physicists.

Eddie Redmayne estimates that the euphoria of being cast as Stephen Hawking for the film “The Theory of Everything,” opening here next Wednesday, lasted a millisecond. Then came the overwhelming fear.

“And that fear remained the whole way through the process,” Redmayne said.

The gentle, freckled 32-year-old British actor was asked to not only lead a film for the first time, but to play a mathematical genius across decades of physical degeneration — all under the watchful gaze of said mathematical genius. Ahead of screening “The Theory of Everything,” Hawking ominously told Redmayne: “I’ll tell you want I think, good or otherwise.”

Never miss a local story.

Sign up today for a free 30 day free trial of unlimited digital access.

With such pressure, Redmayne could be forgiven for quietly slipping into the nearest black hole.

But in the year’s most technically complex role, Redmayne gives what’s surely the performance of his young career, one that seeks to capture not only the step-by-step disintegration of ALS that led Hawking from healthy youth to paralyzed adulthood, but (and more importantly) the scientist’s unvanquished spirit, the unimpeded expansion of his imagination.

“He was given a death sentence,” says Redmayne, referring to the diagnosis given Hawking as a 21-year-old, when he was expected to live only a few years more. Now 72, he went on to father three children, marry twice and author significant discoveries in cosmology as in the best-selling “A Brief History of Time.”

“So you live every single moment to the full, and that’s what I wanted an audience to leave with. That’s what I left this experience with.”

Director James Marsh (“Man on Wire”) remembers well his first meeting with Redmayne, a London native best known for his Tony-winning turn in John Logan’s “Red” and his tender revolutionary Marius in “Les Miserables.” One pint turned to five, the conversation going into the night.

“He was just full of ideas and passion for this,” says Marsh. “He knew somewhat what this might entail in terms of preparation and physicality. Eddie’s crazily ambitious. He’s not ambitious for money or fame. He’s ambitious to do great work. He’s fearless, too. It was a real leap into the dark for him.”

“The Theory of Everything” is based on Jane Wilde Hawking’s 2007 memoir “Traveling to Infinite: My Life With Stephen.” Aside from a biopic, it’s a portrait of an uncommon marriage. Felicity Jones plays Jane, whom Hawking met at Cambridge University in the early ’60s.

The film begins with their early courtship, which coincided with the discovery of a motor neuron disease in Hawking. Redmayne plays each stage of Hawking’s increasing disability, going from a lame leg to a walking stick, to two sticks, to a wheelchair. Gradually he loses his voice, his body language, his facial expressions.

“It felt like solving a puzzle,” says Redmayne.

Redmayne spent four months researching, working on the physicality and feebly studying Hawking’s physics. He trained with a choreographer, met with academics (Redmayne also went to Cambridge), visited with many ALS sufferers and had an expert study old photos of Hawking to trace the disease’s effects.

“There were moments along the way where I know he felt really, really defeated,” says Marsh.

But aside from all the technical challenges, Redmayne imbues Hawking with a sly mischievousness. Much of the performance is in a glint behind his eyes.

“What emanates from him when you meet him is this kind of wit and humor,” says Redmayne. “Even though he can move so few muscles, he has one of the most charismatic, expressive faces you’ve ever seen, which is a weird irony.

“There were many things I found out from meeting with him, but one of the overall things I took away was finding he does not live a disease. He lives forward and has done since he was 21 years old. There’s an unerring optimism to him. That meant every single scene, even when obstacles are being through, find the funny, find the glint.”

When Hawking saw the film a few weeks before its premiere at the Toronto Film Festival, he judged it “broadly true.” But he offered a personal endorsement, giving Marsh his unique computer-generated voice to use in the film.

Redmayne, widely considered a lock for an Oscar nomination, has plans to star in the next film by Tom Hooper (“Les Miserables,” “The King’s Speech”). But he hasn’t worked since filming “The Theory of Everything.” The gravity of the part, for which he lost some 20 pounds, is slowly falling off him.