section_path: History/Early modern number theory/Lagrange, Legendre, and Gauss
section_name: Lagrange, Legendre, and Gauss
paragraph_text: Lagrange, Legendre, and Gauss
  
  Joseph-Louis Lagrange (1736–1813) was the first to give full proofs of some of Fermat's and Euler's work and observations—for instance, the four-square theorem and the basic theory of the misnamed "Pell's equation" (for which an algorithmic solution was found by Fermat and his contemporaries, and also by Jayadeva and Bhaskara II before them.) He also studied quadratic forms in full generality (as opposed to m X 2 + n Y 2 {\displaystyle mX^{2}+nY^{2}})—defining their equivalence relation, showing how to put them in reduced form, etc.
  
  Adrien-Marie Legendre (1752–1833) was the first to state the law of quadratic reciprocity. He also conjectured what amounts to the prime number theorem and Dirichlet's theorem on arithmetic progressions. He gave a full treatment of the equation a x 2 + b y 2 + c z 2 = 0 {\displaystyle ax^{2}+by^{2}+cz^{2}=0} and worked on quadratic forms along the lines later developed fully by Gauss. In his old age, he was the first to prove Fermat's Last Theorem for n = 5 {\displaystyle n=5} (completing work by Peter Gustav Lejeune Dirichlet, and crediting both him and Sophie Germain).
  
  In his Disquisitiones Arithmeticae (1798), Carl Friedrich Gauss (1777–1855) proved the law of quadratic reciprocity and developed the theory of quadratic forms (in particular, defining their composition). He also introduced some basic notation (congruences) and devoted a section to computational matters, including primality tests. The last section of the Disquisitiones established a link between roots of unity and number theory:
  
  The theory of the division of the circle...which is treated in sec. 7 does not belong by itself to arithmetic, but its principles can only be drawn from higher arithmetic.
  
  In this way, Gauss arguably made a first foray towards both Évariste Galois 's work and algebraic number theory.