melancholia vs pessimism

melancholia

noun
  • Deep sadness or gloom; melancholy 

  • depression, characterised by irrational fears, guilt and apathy 

pessimism

noun
  • The condition of being pessimal. 

  • A general belief that bad things will happen. 

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

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