melancholy vs pessimism

melancholy

noun
  • Great sadness or depression, especially of a thoughtful or introspective nature. 

  • Black bile, formerly thought to be one of the four "cardinal humours" of animal bodies. 

adj
  • Affected with great sadness or depression. 

pessimism

noun
  • A general belief that bad things will happen. 

  • The condition of being pessimal. 

  • The doctrine that this world is the worst of all possible worlds. 

How often have the words melancholy and pessimism occurred in a corpus of books? (source: Google Ngram Viewer )