In 1766, on the recommendation of Swiss Leonhard Euler and French d'Alembert, Lagrange succeeded Euler as the director of mathematics at the Prussian Academy of Sciences in Berlin, Prussia, where he stayed for over twenty years, producing volumes of work and winning several prizes of the French Academy of Sciences. Lagrange's treatise on analytical mechanics ("Mécanique analytique", 4. ed., 2 vols. Paris: Gauthier-Villars et fils, 1788–89), written in Berlin and first published in 1788, offered the most comprehensive treatment of classical mechanics since Newton and formed a basis for the development of mathematical physics in the nineteenth century.