Sex and guilt, repression and self-deception are the cornerstones of "A Dangerous Method." The eerie, elegant film charts the mentoring partnership, growing envy and bitter rift between Sigmund Freud and Carl Jung, the fathers of psychoanalysis. If that sounds like an outline for a high-minded PBS documentary, think again. This is powerful drama with risky, mesmerizing performances from Michael Fassbender as Jung, Viggo Mortensen as Freud and Keira Knightley as Sabina Spielrein, the troubled, brilliant beauty who comes between them. While there's more than a whiff of kinky eroticism in a number of scenes, the film pivots as much on political gamesmanship and intellectual dominance as sadomasochistic urges and infidelity.

As the film opens, Jung's fascination with Freud's new "talking cure" inspires him to use the treatment on Spielrein, whose fits of hysterics and stammering seem linked to stimulating whippings her father administered in her childhood. Jung's enthusiastic reports from his Swiss clinic gladden Freud, adding more evidence to his theory that sex impulses are the key to the strange, messy stew of the unconscious.

Mortensen is reincarnated as Freud, becoming a Viennese intellectual of monstrously chilly sophistication and dry, malicious wit. He hopes to groom the Protestant Jung as an ambassador to the Aryan medical community, which views Freudianism with anti-Semitic suspicion.

Even at this early stage of things, there was a growing consensus that therapists ought not to take their patients as sexual partners. It wasn't a hard-and-fast rule. "Black Swan's" Vincent Cassel does a demonic, disheveled cameo as libertine Otto Gross, another founder of the field, who advises Jung to "repress nothing."

Fassbender's Jung is the sunny, dreamy young counterpoint to Mortensen's permafrost Freud. Freud is the incisive theoretician, Jung the teacher who could touch human feelings. But Jung is also a fool for love. Having married for wealth, he requires a mistress, and as the intellectually alluring Spielrein recovers her senses, their relationship heats up. Fearing a scandal that could discredit his newborn style of treatment, Freud chastises Jung with cold-blooded, malicious precision, opening an Oedipal rift that turns politely poisonous.

Director David Cronenberg might seem an idiosyncratic choice for this historical drama. His early horror films offered visions of exploding heads and sexualized car crashes that seem like projections of a disturbed mind. He handles the period story with classical grace, making hushed scenes percolate with tension while revealing the inner nature of each character through deft scalpel strokes.

Fassbender's Jung is a man of large appetites -- see how he heaps his dinner plate with sausages -- and a freethinker drawn to the occult as well as science. The actor's physical vitality is at war with his character's clipped speech and prim decorum. Mortensen virtually disembodies himself as Freud, concealing his action-man vigor behind a starched shirt and reserved bearing. His famous cigar seems to function as a stopper, keeping intemperate thoughts bottled up inside. Knightley as Spielrein is a proto-feminist eager to cast off her corset and engage the world physically, sexually and professionally. Like three chemical substances interacting, each is transformed by the others. Cronenberg peels back the lace curtains of a Merchant-Ivory production and lets us see the turmoil within.