She was always one of the most painfully personal of artists, producing a series of autobiographical canvases that dealt with everything from the consequences of the terrible injuries she suffered in a tram crash to her abortion. But finally the one part of the Mexican artist Frida Kahlo's life that has remained secret - at the orders of her former husband, fellow painter Diego Rivera - has been revealed in a new book published in Mexico.

It tells the contents of a series of letters that Kahlo exchanged with her physician, and confidant, after she suffered a miscarriage in 1932, describing the devastation she felt when she realised that she could never have Rivera's child. The new material is certain to fill out the biography of one of the most fascinating artists of the 20th century, whose colourful life, which included a reputed affair with Trotsky, rivalled her art.

Kahlo's confession, My Beloved Doctor, is a bilingual compilation of the letters she exchanged with Dr Leo Eloesser between 1932 and 1951, which remained hidden for 50 years after her death. Kahlo always began her letters with the phrase 'My beloved doctor', Doctorcito querido. Hence the title of the book.

The personal letters, published in the month of the centenary of her birth, were locked away in trunks and cabinets in her house in Mexico City on Rivera's orders. Rivera, 20 years Kahlo's senior, left strict orders to his trust's caretakers not to open the letters until 15 years after his death in 1957.

However, one of Rivera's patrons left the collection hidden behind bathroom walls inside the house turned museum, fearing it might contain information that would compromise the couple's image. Curators opened the trunks in 2004, a year after the patron's death.

'She felt so disheartened because she would have loved to have a little Dieguito, but her dream did not come true', said Isabel Granen Porrua, in charge of the restoration and compilation of the material found in the house.

Kahlo's inability to bear a child, after the injuries she suffered in a tram crash, was painfully close to her. She had had one abortion when it was clear that her health would not allow her to go through with the pregnancy. When she became pregnant again a couple of years later, she miscarried.

Twelve days after her miscarriage she wrote to Dr Eloesser: 'Doctorcito querido: I have wanted to write to you for a long time than you can imagine. I had so looked forward to having a little Dieguito that I cried a lot, but it's over, there is nothing else that can be done except to bear it.'

In 1931, she wrote to him: 'I'm not painting or doing anything. I dislike the "high society" here [in New York where she had travelled with Rivera] and feel a little rage against all these fat cats, since I've seen thousands of people in terrible misery.'

Kahlo even dedicated a self-portrait to Eloesser in 1940: 'I painted my portrait in the year 1940 for Dr Leo Eloesser, my doctor and my best friend. With all my love. Frida Kahlo.'

In the letters, she elaborates on the first days of her pregnancy; her earlier abortion and her excruciating back pain caused by a tram crash in 1925.

She was operated on more than 30 times during her life. Part of her leg was amputated months before she died in 1954. It was during one of her visits to a hospital in San Francisco that she met Eloesser.

Eloesser went on to play a key role in her relationship with Rivera. In November 1940 he convinced her to reconcile and marry Kahlo for a second time. 'Diego loves you very much, and you love him. It is also the case, and you know it better than I, that besides you, he has two great loves: 1) painting 2) women in general. He has never been, nor ever will be, monogamous,' the doctor wrote in one of his letters to Kahlo.

Kahlo's confidence in her doctor continued to grow and she even told him she was jealous of Guadalupe Marin, Rivera's first wife and the mother of his two daughters.

'Please don't get mad at me over what I'm going to say: this morning, when you invited me to the concert, I was determined to go to make you happy and see you, but when I learnt that Diego invited the friends of that Marin, who I can't stand, to his box, I lost the desire to go. I prefer to speak to you frankly, since I know you understand me and will forgive me for changing my mind.'

The letters are among 30,000 other objects kept in her house long after her death and are currently on display among photographs, notes, sketches, magazines, books and pieces of clothing at her former family home in Mexico City and the Palacio de Bellas Artes, the country's most important cultural centre. Eighty per cent of the material is being shown to the public for the first time. Other items on display to mark the centenary of her birth include X-rays of Kahlo's fractured back, a trolley bus ticket and a note with a lipstick-stained kiss.