It’s a brazenly over-the-top performance, a huge gamble in depicting her character’s mania and self-loathing in such intentionally off-putting fashion. But eventually it pays off as it makes sense in context, and especially as this woman evolves.

For this is a David Cronenberg film – although the pristine, cultured trappings might suggest otherwise – and this time, Knightley is his monster.

Cronenberg has specialised in a peculiar brand of horror film over the decades, with physical mutations serving as the norm in such 1980s movies as Videodrome and The Fly. Here, the transformation occurs within; it’s psychological, invisible, but no less startling. Don’t let the genteel, costume-drama niceties fool you.

Set in the early 20th century in Zurich and Vienna, A Dangerous Method follows the relationship between two of the leading voices in the development of psychoanalysis: Carl Jung (Michael Fassbender) and Sigmund Freud (Viggo Mortensen, a Cronenberg regular of late). Knightley plays Sabina Spielrein, the wealthy Russian who is as beautiful as she is tormented, and who ultimately comes between these two men.

Sabina goes to Jung as his patient, not only shaking up his dull, structured life but also providing him a bountiful source of research for the new “talking cure” he’s crafting. (The film, written by the esteemed Christopher Hampton and based on his play The Talking Cure, is itself based on the John Kerr book A Most Dangerous Method.)

Seems she’s as screwed-up as she is because of spankings her father gave her starting in early childhood, punishment that she didn’t just endure but actually began to welcome and find sexually stimulating.

%TNT Magazine% keira 2

The buttoned-down Jung is fascinated from a scholarly standpoint but also secretly aroused as a man; Fassbender, with his proper dress and carriage, quietly conveys Jung’s inner conflict, his percolating desire.

But Jung also turns to his mentor, Freud, for advice. Freud, of course, thinks every symptom is a manifestation of some sort of subconscious sexual impulse, so Sabina’s case gives these two much to chew on. Mortensen, star of Cronenberg’s Eastern Promises and A History of Violence, dials down his smouldering masculinity here for a performance that’s dryly humorous, full of snarky vanity and droll little digs.

Eventually another troubled mind turns this three-way into a foursome when Freud sends Otto Gross (Vincent Cassel), a patient of his, to Jung for treatment. Otto is all id, impossible to control – and Cassel does play casual menace beautifully – but he also inspires Jung to follow his own impulses, even though they’re at odds with the comfortable life he shares with his docile, moneyed wife (Sarah Gadon) and their children.

%TNT Magazine% keira 3

Jung’s interludes with Sabina provide sudden, stunning moments of sadomasochistic intensity, which punctuate a prevailing tone that might actually be too restrained. Their afternoons at her sparse apartment are thrilling, though, and they help maintain a wild streak in a film that is crisply and meticulously shot and edited.

As Sabina’s behaviour settles down – as she morphs from patient and lover to student and therapist in her own right – the relationship between Jung and Freud grows more bitter and volatile.

The passive-aggressive series of letters they exchange provides some much-needed humour in this frequently serious, intellectual exercise. But they’re onto something, though: As anyone who has ever been in therapy can attest, the danger is inside all of us, whether we’re willing to face it or not.