Wilson, and first published by Waring in his Meditationes Algebraicæ; he investigated in 1775 under what conditions and ( and having been discussed by Euler)
are quadratic residues, or non-residues of odd prime numbers, ; he proved in 1770 Méziriac's theorem that every integer is
equal to the sum of four, or a less number, of squares. He proved Fermat's theorem on , for the case ,
also Fermat's theorem that, if , then is not a square.
In his memoir on Pyramids, 1773, Lagrange made considerable use of determinants of the third order, and demonstrated
that the square of a determinant is itself a determinant. He never, however, dealt explicitly and directly with determinants; he simply obtained accidentally identities which are now recognised as relations between determinants.
Lagrange wrote much on differential equations. Though
the subject of contemplation by the greatest mathematicians (Euler, D'Alembert, Clairaut, Lagrange, Laplace), yet more
than other branches of mathematics did they resist the systematic application of fixed methods and principles. Lagrange established criteria for singular solutions (Calcul des Fonctions,
Lessons 14–17), which are, however, erroneous. He was the first to point out the geometrical significance of such solutions. He generalised Euler's researches on total differential equations of two variables, and of the ninth order; he gave a solution of partial differential equations of the first order (Berlin Memoirs, 1772 and 1774), and spoke of their singular solutions, extending their solution in Memoirs of 1779 and 1785 to equations of any number of variables. The discussion on partial differential equations of the second order, carried on by D'Alembert, Euler, and Lagrange, has already been referred to in our account of D'Alembert.
While in Berlin, Lagrange wrote the "Mécanique Analytique," the greatest of his works (Paris, 1788). From the principle of virtual velocities he deduced, with aid of the calculus of
variations, the whole system of mechanics so elegantly and
harmoniously that it may fitly be called, in Sir William Rowan Hamilton's words, "a kind of scientific poem." It is a
most consummate example of analytic generality. Geometrical figures are nowhere allowed. "On ne trouvera point de figures dans cet ouvrage" (Preface). The two divisions of mechanics–-statics
and dynamics–-are in the first four sections of each carried out analogously, and each is prefaced by a historic sketch of principles. Lagrange formulated the principle of least action. In their original form, the equations of motion