David Cronenberg has long been recognised as a prime exponent of the psychological thrillers known as body horror movies, stories of terror involving parasites, metamorphoses, diseases, decomposition and physical wounds, such as Shivers, Videodrome, Naked Lunch and his version of The Fly. Now, as he approaches 70, an enfant terrible turned cinematic elder statesman operating from the Canadian fringe of the cultural mainstream, he has stood back from the visceral fray.

His engrossing, admirably acted new film, A Dangerous Method, takes an objective, historical look at the early days of psychoanalysis and the people, notably Sigmund Freud and Carl Jung, who provided us with the conceptual framework and language for discussing the phenomena and experiences he has been dramatising over the past 40 years.

Helping him in this enterprise is the British playwright and screenwriter Christopher Hampton, whose apposite texts of the period include Total Eclipse (a story of the tempestuous relationship between Verlaine and Rimbaud) and Carrington (the Bloomsbury affair between Lytton Strachey and the artist Dora Carrington), as we ll as Mary Reilly, a reworking of the body horror classic Dr Jekyll and Mr Hyde. Hampton drew on A Most Dangerous Method by the American clinical psychologist John Kerr for his National theatre play, The Talking Cure, and this has now become the basis for his piercingly intelligent screenplay about the friendship and professional association between Jung and Freud in the early 20th century and the roles in this relationship of two of their analysands, Sabina Spielrein and Otto Gross.

Jung (Michael Fassbender) was 29, fairly recently married to the wealthy Emma, and working at a hospital in Zurich in 1904 when Sabina (Keira Knightley), aged 18, a Russian Jew and fluent German speaker, was referred to him in a deeply distressed condition. He decided to experiment with the "talking cure", or psychoanalysis, then being used in Vienna by the 48-year-old Sigmund Freud (Viggo Mortensen), a well-established but highly controversial figure.

Fascinated by and attracted to the highly intelligent Sabina, who shows a considerable aptitude for medicine and psychology, Jung corresponded about this case with Freud, who subsequently passed on to him an infinitely more deeply disturbed patient, Otto Gross (Vincent Cassel).

Gross was himself a psychiatrist in his 20s and suffering, it transpired, from dementia praecox (as schizophrenia was then known). Gross by name, gross by nature, he was brilliant, insightful and liberated in a way the highly respectable, middle-class Jung and Freud were not. "Never repress anything," was his belief, and he acted as the catalyst that both freed and trapped Jung, taking him beyond the expected transference and into an unprofessional sexual relationship with Sabina. Their sadomasochism gave them a better understanding of her condition while inducing de ep feelings of guilt. It led to a dangerous relationship that lasted for some years and became both traumatic and healing.

Meanwhile, the friendship between Freud and Jung developed rapidly, with the older man, a secular Viennese Jew, deciding that the Swiss Protestant psychologist was his natural heir. But along the way, over a period of around five years, Cronenberg and Hampton trace a gradual change in their relationship. As John Kerr puts it at the end of his book, "the sexual, the religious, the theoretical became hopelessly intertwined" in a manner that these students of the mind found it impossible to disentangle. In one of the funniest, most beautifully acted and most frightening scenes in the movie, Jung attaches significance to a cracking noise in the woodwork of Freud's study, announcing that it's some kind of portent. Nothing in his view is coincidence. "That is an example of a so-called catalytic exteriorisation phenomenon," he claims, and predicts that another will follow. And so it does, to the furious annoyance of the rationalist Freud.

There is drama in the choice of smoking matter. Freud draws deeply on his cigar, speaking ironically, acting manipulatively, simultaneously bold and cautious in advancing his theories about sexuality. Jung puffs philosophically on his pipe, quietly questioning Freud's conviction that sexuality lies at the roots all neuroses, and coming to believe that his mentor's views are overly deterministic and inflexible. Yet he embraces parapsychology and telepathy and ultimately (though this was to come long after the timespan of this movie) gives credence to the possibility of flying saucers.

Beyond them, passing from the rational into the realms of madness, is the uninhibited Otto Gross, snorting cocaine and puffing on his hand-rolled cigarettes. He explores the ultimate consequences of their discoveries and is prepared to pursue them even if self-destruction is the result.

They all become too much for each other. Gross finishes up starving to death in 1920. Freud is torn over seeing himself as the father that the superstitious Jung wishes to destroy. Jung believes that psychoanalysis may save the world and sees in Sabina the positive combination of intelligence and intuition that might lead to universal therapy. She, we learn, returned to Russia, became a celebrated psychologist in the Soviet Union and was an early victim of the Holocaust.

Jung was deeply ambivalent about the future, convinced on the one hand that America represented a liberating force and on the other that some apocalypse was about to be visited upon mankind. And indeed it was by the first world war, the point at which A Dangerous Method ends, concluding the era of hope and discovery it invites us to explore. We are left to ponder the legacy of Freud and Jung and the complex way it continues to affect the way we think and colour our daily lives.