Robin Williams was one of many comedians who made people laugh while simultaneously struggling with a personal darkness. Are comics more prone to depression - and if so, why?
"It doesn't take a genius to work out that comedians are a little bit nuts." Those were the words of comedian Susan Murray earlier this year, responding to an academic study that suggested comedians had unusual psychological traits linked with psychosis.
It takes a certain type of person to stand up and make a fool of themselves in public. But there is a difference between being a bit zany and suffering mental health problems.
However, the image of comedians as tortured souls who tell jokes in an attempt to dispel their inner demons has become common over the years.
Kenneth Williams once said: "I certainly wouldn't call myself a happy human being. All the comedians I've known have been deeply depressive people, manic depressive... They kept it at bay with this facade."
Tony Hancock took his own life. Spike Milligan suffered profound depression and published a book titled Depression And How To Survive It.
Peter Cook, John Cleese, Ruby Wax, Jack Dee, Caroline Aherne and David Walliams are among the others who have spoken about their inner turmoil.
Stephen Fry, who has bipolar disorder, presented a TV documentary titled The Secret Life of the Manic Depressive in 2006. Last year, he revealed he had tried to kill himself in 2012.
Fry said: "There are times when I'm doing QI and I'm going, 'ha ha, yeah, yeah' and inside I'm going, 'I want to die.'"
Robin Williams was also reported to have had bipolar disorder, which seriously affects the mood, with people swinging between phases of extreme happiness and creativity to severe, crushing depression.
"Among the creative professions, it's very, very common," says comedy producer and performer John Lloyd, who made the TV series QI and Blackadder.
"There's a very, very high incidence of bipolar disorder. It's because stable people think the world's fine as it is. They don't see any particular need to change it.
"Creative people don't feel like that. People who want to change the world tend to suffer a lot for it."
Comedians, Lloyd adds, are more likely to have extremes of personality because they are "more extreme people".
"Robin Williams was a complete genius and did an enormous body of work. You can't do that if you're just depressed. You're more likely to do that if you're bipolar and you have terrific bursts of creative activity.
"And there's a price for everything. Often, and I know this as a television producer, if you've finished a series and you've been on a high with pumping adrenalin every day, when you come down from it you're really low. It's punishing."
In January, academics from the University of Oxford published the results of research into comedians' psychological traits (this is the report Susan Murray was responding to above).
Professor Gordon Claridge, of the University of Oxford's Department of Experimental Psychology, studied personality questionnaires filled in by 523 comedians (404 men and 119 women) from the UK, US and Australia.
"We found that comedians had a rather unusual personality profile, which was rather contradictory," Prof Claridge says.
"On the one hand, they were rather introverted, depressive, rather schizoid, you might say. And on the other hand, they were rather extroverted and manic.
"That was a rather unusual profile. The actors we compared them with didn't show that, and this was highly significantly different from the norms on the test.
"Possibly the comedy - the extroverted side - is a way of dealing with the depressive side. Of course, this is not true of all comedians."
Laughing to cope
It is not. Not every comedian has difficulties, and depression is far from particular to creative personalities.
Depression is the single biggest killer of men aged 20-49 in the UK, according to the Campaign Against Living Miserably (Calm). It touches all corners of society.
Dr Nick Maguire, a senior lecturer in clinical psychology at the University of Southampton, says there may be a connection between depression and comedy - but "it's certainly not a very strong one".
However, he says different people have different ways of coping.
"People often isolate themselves," he explains. "Another way of temporarily reducing the impact of those emotions is to make people laugh, to make people like you.
"Unfortunately, the release can sometimes be very temporary. It's fine as long as it's happening, but when you go home again, what do you do?"
In public, Robin Williams always seemed to be performing, always the wise-cracking firecracker who wanted to make people laugh.
He made no secret of his problems with alcohol and marriage break-downs, but spoke more guardedly about his bouts of anxiety in interviews, usually attempting to look on the bright side.
"Every time you get depressed, comedy will be there to drag your ass out of it," he told The Guardian in 1996.
Terry Gilliam, who directed Williams in the Golden Globe-winning film The Fisher King, said the star's comedic talent had been "a miracle", but such a gift "doesn't come from nothing".
"When the gods gift you with the kind of talent Robin had, there's a price to pay," the Monty Python star told the BBC.
"It comes from deep problems inside. A concern, all sorts of fears. Yet he could always channel those things and turn them into gold.
"I think that comes with the territory."