According to Jonah Lehrer of the New York Times Darwin may have been able to concentrate on his work because of depression. Darwin wrote about many ailments he faced "fits, flurries, air fatigues and head symptoms" but the real Darwin downer was not lactose intolerance or Chagas disease. He wrote to a psychiatrist that sometimes he would erupt in "hysterical crying" when Emma would leave him alone. He noted that the race to discover is for the strong and he would be forced to watch other great men make huge advances in science. However, Darwin also talked of his work as a salvation from his sour moods. He is even quoted as saying that "work is the only thing that makes life endurable for me".
From an evolutionary standpoint depression should be seen as a malfunction of the mind that would make it less inclined to function in society or leave offspring and would therefore be selected against. However, depression is very prevalent throughout human history. While most mental illnesses remain in less than 1% of the population, clinically diagnosed depression is like the common cold. How can something that makes you lose sleep, your appetite, and your libido still exist in so pervasively?
Like the fever helps the immune system, depression may have an unknown effect on either performance at a given task or protection against sudden crises, but up to this date, I know of no experiments on the purpose of depression. It is always assumed that depression is a bad thing that needs to be cured with drugs. In conclusion, would Darwin have written "The Origin of Species" if he was depressed?
New York Times