“A Dangerous Method,” David Cronenberg’s new film, starts out with a case of hysteria. A woman, clumsily restrained by nondescript handlers, writhes and howls inside a horse-drawn carriage, her mania at once drowned out and underscored by the thunder of hooves and the shrieking of strings on the soundtrack.We learn soon enough that she is Sabina Spielrein (Keira Knightley), a disturbed young Russian en route to a clinic in Zurich some time in the early 20th century. But at the moment, she seems more like a wild animal. This abrupt and rather frightening introduction — the viewer is pitched headlong not only into Sabina’s company but also into her condition — is an emphatic announcement of some of the film’s intentions.The subject of its analysis — a deceptively dry clinical term that is not out of place in reference to this subtle and intellectually thrilling true story — is the way unruly desires and emotions struggle with efforts to tame and confine them.The startling violence of Sabina’s disorder, which turns her, even in moments of relative calm, into a twisted, sputtering wreck, is also a signal that, appearances to the contrary, “A Dangerous Method” (based on a play by the film’s screenwriter, Christopher Hampton, that was drawn from a book by John Kerr) is not just another decorous Oscar-season costume party. The rigor and repression on display here are hardly the quaint artifacts of a bygone social order, which we in the audience can congratulate ourselves on having left behind. What we are witnessing, rather, is the raw, liberating and terrifying emergence of a distinctly modern way of understanding, and trying to assuage, some of the pain and intensity of being alive.Sabina is treated in Zurich by Carl Jung (Michael Fassbender), who calls the nascent method for dealing with problems like hers “psychanalysis.” Jung’s mentor in Vienna corrects him — he says it sounds more “logical” with the “o” in the middle — and since the mentor in question is none other than Sigmund Freud (Viggo Mortensen), the younger man defers, at least on matters of pronunciation, and at least for a while.Hopscotching through a series of episodes from 1907 up to the eve of World War I, “A Dangerous Method” traces the shifting relationships among its principal characters. Sabina is Jung’s patient, his lover and finally a colleague. At the same time Freud and Jung act out a complicated Oedipal drama, as the younger analyst evolves from promising disciple into Freud’s heir apparent and then a dangerous rebel, whose mystical interests fly in the face of psychoanalytic orthodoxy.Sabina, emotionally connected to Jung (who remains guiltily devoted to his aristocratic wife, Emma, played by Sarah Gadon), finds more intellectual affinity with Freud, who reminds her at one point that, unlike Jung, they are both Jews. (This is of course perfectly true, but in the context of the movie, the observation is a bit surreal. Viggo? Keira? Who knew!)“A Dangerous Method” is full of ideas about sexuality — some quite provocative, even a century after their first articulation — but it also recognizes and communicates the erotic power of ideas. There are scenes of kinky activity between Sabina and Jung that will no doubt enjoy long life in specialized corners of the Internet, but the most unsettling aspect of “A Dangerous Method” may be the links it suggests between sex and thinking. The mind is both slave and master of the body’s appetites, and the absurd and terrifying task of stabilizing that dynamic, in theory and in practice, is embraced equally by the film and the fragile, serious historical figures who inhabit it.The technique Jung adopts with Sabina, even before traveling to Austria to meet Freud, is the talking cure. She sits with her back to him and recalls traumatic episodes from her childhood, while he takes notes and asks questions. This kind of scene is familiar enough — from Woody Allen and “Portnoy’s Complaint” and “The Sopranos,” and maybe from real life as well — that seeing a primitive incarnation is at once droll and curiously exciting. It is also marvelous to see Freud, that embattled colossus, restored to his human dimensions by Mr. Mortensen. His sly performance is so convincingly full of humor, warmth and vanity that it renders moot just about every other posthumous representation of the patriarch of psychoanalysis.In various combinations and in shifting roles, Sabina, Jung and Freud are engaged in an expedition into the uncharted territory of the unconscious. Jung and his patient, in particular, do so with a sense of novelty and risk. The feeling of stepping into terra incognita makes “A Dangerous Method” something of an adventure story. It also at times has the quiet, uncanny mood of a horror movie, albeit one whose monsters are invisible, living inside the souls they menace.