David Cronenberg, who has made a career flouting taboos surrounding sex, death and undifferentiated anxiety, goes to the source of those cardinal themes in “A Dangerous Method.“

The fact that this elegant, even prim historic drama contains nothing more untoward than a few episodes of naughty bedroom spanking may scandalize fans who have come to associate Cronenberg with edgier visual and thematic fare (those ghastly gynecological instruments in “Dead Ringers“! Jeff Goldblum’s face in “The Fly“! Pretty much every scene in “Crash“!).

But its very restraint makes “A Dangerous Method“ perhaps Cronenberg’s most transgressive movie yet, one in which ideas -- rather than their fetishistic signifiers -- possess more energy and verve than the most calculated shock effect.

When the movie opens in 1904, a young woman named Sabina Spielrein (Keira Knightley) arrives at a psychiatric hospital in Zurich, contorted in paroxysms of full-blown hysterics.

She comes under the care of a young psychiatrist named Carl Jung (Michael Fassbender) who, following the experimental techniques of a neurologist named Sigmund Freud, begins simply to talk to his patient and engage her in sessions of free association. (The approach has the added advantage of making short work of otherwise ponderous exposition, especially regarding Jung’s new marriage.) He begins to correspond with Freud (Viggo Mortensen), who when they finally meet at his home in Vienna leads his visitor on a conversation that will last 13 hours.

Of such first dates are great passions born, and “A Dangerous Method“ captures Jung and Freud’s budding mutual comprehension with the giddy sweep of a young romance. It may be Jung and Spielrein whose relationship becomes more erotically complicated (see “spanking, naughty“), but the core of Cronenberg’s film -- adapted by Christopher Hampton from his play “The Talking Cure“ -- is the intellectual love story between two men whose six-year collaboration would shake and shape modern thought, but whose temperaments, priorities and class differences would eventually drive them apart.

So viewers are urged to look past Knightley’s showy performance -- jutting out her chin makes a grotesque mask of her otherwise flawless face -- and focus more profitably on Fassbender and Mortensen, who breathe palpable warmth and life into otherwise distant, enshrined figures.

Coming off an extraordinary year during which he’s played a 19th-century British aristocrat (“Jane Eyre“), a comic book super-villain (“X-Men: First Class“) and a Manhattan sex addict (“Shame“), Fassbender is almost unrecognizable behind glasses and neatly slicked-back hair as the right and proper Jung, for whom the idea of sexual repression is not only healthy but necessary for the equilibrium of Western civilization. (He’ll be challenged in that belief by a patient named Otto Gross, played with manic excess by Vincent Cassel.)

Mortensen, in the film’s most subtle, canny performance, infuses Freud with unexpected earthiness, wit and knowing wisdom. When the pair come to the United States to present the theories of the still-new psychoanalytical movement, Freud almost looks as if he regrets the coming upheaval. “Do you think they know we’re on our way, bringing them the plague?“ he asks Jung. When the latter begins to evince an interest in mysticism and the collective unconscious, Freud reacts with disapproval, tenaciously defending his nascent discipline against anything that might marginalize or threaten its scientific legitimacy.

Meanwhile, Jung’s relationship with Spielrein follows its own course, with the patient soon becoming a student and a clinician in her own right. Even at the height of their physical involvement, they’re attracted to what’s inside each other’s heads, at one point making their mutual friendship with Freud resemble an intellectual menage-a-trois.

Mortensen has called “A Dangerous Method“ Cronenberg’s “Merchant-Ivory picture,“ but it just as often resembles a Woody Allen movie -- literate, sophisticated and deeply concerned with sex and manners. (It’s even mordantly funny, as an early scene at the Freud family dinner table attests.)

But more than Merchant or Ivory or Allen, “A Dangerous Method“ bears the stamp of Cronenberg, who with such recent films as “A History of Violence“ and “Eastern Promises“ has made his imagery more simple and ascetic, the better to express the betrayals, boundary violations and jealousies roiling just beneath.

Between the subject matter and modulated, restrained style, “A Dangerous Method“ feels like a movie Cronenberg was born to make. But with its primal urges swimming so close to the decorous surface, it also feels like the movie he’s been making all along.