Optimism began as a label for a philosophy, and it reached English as the name of a book that mocked that philosophy.

The philosophy belonged to Gottfried Leibniz. In his Théodicée of 1710, he argued that a supremely wise and good God must have created the best of all possible worlds. He used the Latin optimum, "the greatest good," for this. Optimum is the neuter of optimus, "best."

The French word optimisme came next. In February 1737 the Jesuit journal of Trévoux described Leibniz's view as "le systême de l'Optimum, ou l'Optimisme." The word was the journal's, not Leibniz's.

During the 1700s the label spread to any doctrine that called the world good or the best possible, including Alexander Pope's. Voltaire had backed the Leibnizian thesis in Zadig in 1747. The Lisbon earthquake of 1755 changed his mind. He attacked optimism in a poem on the disaster in 1756, and then in Candide, ou l'Optimisme, published in January 1759.

The novel's tutor, Pangloss, teaches that all is for the best in the best of all possible worlds while catastrophes pile up around him. Candide calls optimism the mania for insisting that all is well when one is badly off. By late February 1759 the book was banned in Geneva and Paris. It still sold an estimated 20,000 to 30,000 copies that year.

English took the word from translations of Candide in 1759, when three appeared. So the first English optimism was a doctrine under attack.

The cheerful personal sense came later. Etymonline records a hopeful outlook on life from Shelley in 1819. Larousse says the everyday French meaning emerged only at the end of the 1700s. Optimist went the same way: a believer in the metaphysical doctrine in 1759, a person of hopeful disposition by 1766.

Optimism soon acquired an opposite. Pessimism, from Latin pessimus, "worst," was formed in French on the model of optimisme. Coleridge borrowed it into English in 1794, meaning the worst possible condition. The sense of looking only on the dark side followed by 1815.

Optimum itself entered English in 1879, first in biology, for the most favorable conditions for growth.