David Ruelle, in a review of Henri Poincaré’s Science et Méthode, Nature 391, 760 (1988) and reproduced in page 1113 of Am. J. Phys., Vol. 67, No. 12, December 1999, wrote:
[Poincaré] knew, as every mathematician does, that if you have to solve a difficult problem, you first spend time looking at it from different angles. A number of ideas present themselves, which you pursue conscientiously, but you fail to solve your problem. How then do you proceed? Here is what may happen: “One evening I took black coffee, contrary to my custom. I could not go to sleep. Ideas came up in swarms, I sensed them clashing until a pair would hook together, so to say, to form a stable combination. By morning… I had just to write the results, which only took me a few hours.”