There is a joke Billy Wilder liked to tell about Arthur Miller and Marilyn Monroe. Wilder had worked with Monroe on Some Like it Hot when she was married to Miller and recalled that when the couple were engaged, Miller had taken Monroe to meet his mother. Mrs Miller lived in a tiny apartment in New York, with walls so thin that when Monroe got up to go to the bathroom she worried everyone might hear her and turned on all the taps. The next day, Miller rang to ask his mother what she thought. 'She's sweet,' said Mrs Miller of her future daughter-in-law. 'A wonderful girl. But she pisses like a horse!'

For better or worse, the greatest American playwright of the 20th century will be best remembered by many for his brief second marriage. His first was to Mary Grace Slattery, a fellow student at the University of Michigan who encouraged him to write and on whose salary they were often forced to live before his plays became successful (she worked as a secretary). They met at a party in someone's basement and he asked her out on a date. She paid for the movie and for malted milks afterwards. 'Pretty soon,' she told an interviewer in 1949, 'Arthur borrowed my radio and everything was understood.' They married two years after graduation and had two children, Jane Ellen and Robert.

When he met Monroe on the set of As Young as You Feel in 1951, he had written All My Sons and Death of a Salesman. She'd been crying because her agent had just died. 'You're the saddest girl I've ever met,' he later told her and she took it as a compliment. 'You're the only one who ever said that to me,' she replied. Not long after that first meeting, Miller saw her at a party held for him by the producer Charles Feldman. She seemed, he later wrote in his autobiography, Timebends, 'ludicrously provocative ... if only because her dress was so blatantly tight, declaring rather than insinuating that she had brought her body along and that it was the best one in the room.'

Elia Kazan, who was sleeping with her at the time, claimed to have spotted 'the lovely light of lechery' in Miller's eyes that night, though their relationship didn't begin until four years later. They met again in 1955 at the Actors' Studio in New York. 'She was a whirling light to me then,' Miller wrote, 'all paradox and enticing mystery, street-tough one moment, then lifted by a lyrical and poetic sensitivity that few retain past early adolescence.'

Miller left his wife and children and married Monroe. By then, he had added The Crucible and View from the Bridge to his achievements, and the year they got married, 1956, he was found guilty of contempt of Congress for refusing to name names to the House Un-American Activities Committee. The chairman of HUAC, Francis Walter, offered to drop the charge if Monroe would pose for a photograph shaking his hand. She refused. Two years later the charge was dropped anyway.

Though Miller claimed not to have written The Misfits specifically for Monroe, the film's production was to become a defining moment in their lives. 'He could have written me anything,' Monroe said of the role of the unhappy divorcee, 'and he comes up with this.' She tried to commit suicide then, and she and Miller decided to split. Inge Morath, a Magnum photographer, had come to document the shoot with Henri Cartier-Bresson and took some famous photographs of Monroe dancing alone under a tree. Later, she started seeing Miller and they married in 1962.

Morath was a dynamic, witty intellectual. She had grown up in Austria, Germany and France, resisted the Nazis and become one of the first women to join Magnum. She was familiar with Miller's work before she met him, having seen The Crucible performed by Yves Montand and Simone Signoret in Paris, but when Monroe died she was blamed for daring to succeed her. 'People were terrible to me,' she told me when I met her in 1999, three years before her death. 'It was just awful.'

Miller and Morath stayed together until she died. Then Miller started seeing Agnes Barley, an artist 55 years his junior who had assumed, until she met him, that he was dead. His last play, which opened in Chicago late last year, was generally believed to have been based on the events surrounding the production of The Misfits. 'I like the company of women,' Miller told a New York Times journalist recently. 'Life is boring without them.'

Miller's memory will perhaps be best preserved by his and Morath's daughter, the talented writer and director Rebecca Miller. Miller fille, who met her husband Daniel Day-Lewis when he was starring in the film version of The Crucible, has, over almost a decade, accumulated hours of footage of her father. She plans to make a documentary about him one day.