Ethan Canin has done something extraordinary: he has written a spellbinding novel about math. Suddenly readers—even those whose command of arithmetic reached its zenith in the fourth grade—will find themselves devouring pages on sophisticated algebraic problems with exotic names like the Malosz theorem and the Abendroth conjecture. Forget courtroom drama or emergency room suspense. In Canin’s new novel, A Doubter’s Almanac, the most intense action resides between the ears of Milo Andret, a brilliant, tortured mathematician.

For Canin, writing fiction and solving equations aren’t opposite endeavors but two approaches to cracking the same code. “Both the writer and the mathematician are finding new ways to think about the world,” he says. “Math is calculation, but really, it’s imagination. If you look at those thought experiments that Einstein did, those are pieces of imagination that allow you to invent understandable things. Other people think of math as a trick of brute calculation, but from my conversations with mathematicians, it’s much more of a freewheeling thing.”

A Doubter’s Almanac took years to write. “Brutality” and “despondency” are the words Canin connects with the experience. At one point, Canin almost pushed the project aside. “About a year and a half ago, I went out with my friend, and I told him, ‘I’m going to have to give the money back to Random House,’ ” remembers Canin. His wife and editor talked him out of it. At over 500 pages, the novel is an ambitious achievement that channels the gravity, heft, and familial dysfunction of Jonathan Franzen’s work with the humanity of Marilynne Robinson (a colleague of Canin’s at the Iowa Writers’ Workshop).

What kind of writer has the skill, much less the will, to write such a novel? A few weeks before the book’s publication, Canin took a break from rewiring his house in Iowa City to discuss his wide-ranging interests. (Most writers don’t double as amateur electricians, as Canin does. Most writers didn’t study engineering at Stanford or medicine at Harvard, either.)

“You know those Myers Briggs personality tests?” asks Canin. “I always come out in the middle. To think you have to be one or the other—right brained or left brained—is a huge simplification.”

Canin was born in Michigan and lived most of his childhood in San Francisco. He loved math at an early age and would spend hours working logic puzzles. He entered Stanford to study engineering, a path that veered when Canin was introduced to the work of John Cheever in a creative writing class. “I fell in love with Cheever’s writing,” says Canin. “It was something that moved me so powerfully, the decision [to pursue writing] was fairly easy.”

He began writing short stories and was accepted at the prestigious Iowa Writers’ Workshop. But once there, Canin hit a creative wall. Burdened by the pressure to produce new work, Canin faltered. He brought old pieces to classes and presented them as new. “I wanted to be a writer and I’d published a couple of stories, but I was in a panic,” says Canin. “And I realized here I was going to waste all that science background.”

His fallback plan? Harvard Medical School.

Ironically, at medical school Canin began to write again, skipping classes to work on stories. (“I learned best from textbooks anyway,” he says.) “I wrote all the time at Harvard,” says Canin. “Mostly, because I wasn’t supposed to be doing it, and there’s nothing as inspiring as doing something you’re not supposed to be doing.”

Canin graduated from Harvard and moved back to San Francisco where he began a residency in internal medicine. Two years into the program, however, he made the decision to give writing another shot. “I had to force myself to quit medicine,” says Canin. “But I knew that if I didn’t need the money, I would never finish a book.”A Doubter's Almanac

With two other friends, he founded the San Francisco Writer’s Grotto, a writers’ collective. “It was like going to work,” remembers Canin fondly. “We would write in our separate offices from nine until twelve and then have lunch together. After a while editors started coming to lunches and people started getting published.”

Over the last three decades, he published six other books, moved back to Iowa, climbed the bestseller lists, and witnessed the birth of his three children. Although he has no plans to practice medicine again, he credits his experience as a physician and as a parent for giving him a sense of empathy he could never have grasped as an MFA student. That doesn’t make the work any easier.

“I never like anything I write,” says Canin. “I’d always love another crack at it.” Yet for Canin, and for his embattled hero Milo, there is salvation in the effort.

“Work is one of the few things that leads to satisfaction,” says Canin. “Especially in this age of the internet and how things are so brief, the idea of doing something of great difficulty that demands devotion, it’s something that the saints might have seen: small good works repeated daily.”

As the brilliant Milo Andret tells his son, “Only a small part of it is talent. The rest is determination. Stick to your ramparts, my boy, no matter who else is trying to shout you off of them. The will is everything.”

Kirk Reed Forrester is the Books Editor for Virtuoso Life, a contributing editor at flower magazine and a features writer for Kirkus Reviews. She lives in Birmingham, Alabama.