It was not until he was seventeen that he showed any taste for mathematics - his interest in the subject being first excited by a paper by Edmond Halley which he came across by accident.
Lagrange is one of the founders of the calculus of variations.