The philosophy that made Leibniz famous reached his own century in pieces. The only book of philosophy he published in his maturity was the Theodicy of 1710, and it appeared without his name; the rest went out in journal articles and in letters to more than a thousand correspondents. The three texts now read as his system — the Discourse on Metaphysics, the New Essays on Human Understanding and the Monadology — were all printed after his death, the Discourse last of all, in 1846. For forty years he earned his living as librarian, historian and adviser to the dukes of Hanover, and he wrote his philosophy in the time their commissions left him.
That philosophy rests on one principle: nothing is the way it is without a reason why it is so and not otherwise. Followed all the way, it led to the two claims he is remembered for. The world is made, at bottom, of simple units he came to call monads, closer to minds than to atoms, each unfolding from within, none acting on any other, all kept in step by an agreement God set up at the start. And God, who also does nothing without a reason, chose to create the best of all possible worlds. That does not mean all is well: a world containing evil can still be the best whole that was possible, because everything in it is so connected that removing one evil would change all the rest.
The pressure behind this came from the new science. Descartes and his followers explained nature as matter in motion, which served physics well and left it unclear where purpose, freedom and the soul could fit. At fifteen, as Leibniz recalled more than fifty years later, he walked in the Rosental, a wood outside Leipzig, debating whether to keep the substantial forms of the scholastics — the inner principles that made a thing what it was. Mechanism won, and he turned to mathematics. By 1686 he had changed his mind: the Discourse on Metaphysics brought the forms back, while insisting that particular events should still be explained mechanically. Keeping both the machine and something like a soul in every thing remained his project from then on.
In 1667 the young lawyer entered the service of Johann Christian von Boineburg, a former minister of the Elector of Mainz. In 1672 he went to Paris with a plan to turn Louis XIV's armies away from Holland and toward Egypt. The French war on the Dutch overtook it, but he stayed four years, studied mathematics with Christiaan Huygens, the Dutch physicist, and by late 1675 was writing the ∫ and dx of the calculus, the notation still in use. On his way to a post in Hanover in November 1676 he called on Spinoza, whose Ethics was not yet published. In Spinoza's God everything follows by necessity from the divine nature; against it Leibniz spent decades setting a God who understands every possible world and chooses among them.
Hanover wanted other things from him. For years he tried to drain the Harz mines with windmills, until Duke Ernst August shut the project down in 1685 and set him to write the history of the Guelfs, the ducal family. He searched archives in Germany, Austria and Italy from 1687 to 1690 and never finished the book: the manuscript stops at the year 1005 and was printed only in 1843–46. He also persuaded the Elector of Brandenburg to found a society of sciences in Berlin in 1700, and he worked for decades, without result, to reunite Catholics and Protestants. In the New System of Nature, printed in a Paris journal in 1695 under his initials, he laid his system before the public for the first time.
Leibniz had published the calculus in 1684; Isaac Newton had worked out his own version in 1665–66 and kept it private. When Newton's supporters accused Leibniz of plagiarism, the Royal Society, with Newton as its president, set up a committee that never asked for Leibniz's side. Its report, published early in 1713, was written by Newton himself. In 1714 the Elector of Hanover became George I of Great Britain and left Leibniz behind. From Hanover he argued about space, time and God's workmanship with Samuel Clarke, Newton's ally, in the letters later printed as The Leibniz-Clarke Correspondence. He died on 14 November 1716, before answering Clarke's last reply. No one from the court but his secretary came to his funeral.
Through the eighteenth century he was known chiefly by the Theodicy, and after 1759 by Voltaire's Candide, in which the tutor Pangloss turned the best of all possible worlds into a joke. The New Essays, printed in 1765, began to repair that reputation, but a fuller reckoning waited for the papers in Hanover: in 1901 and 1903 the French logician Louis Couturat drew on them to argue that Leibniz had anticipated the nineteenth century's algebra of logic. Historians now agree that he invented the calculus independently of Newton. The complete edition of his writings, begun by the Prussian Academy in 1923, is still unfinished.