Why is the integer equation called the Pell equation?[more]
In 220 BC, was discovered by Archimedes with methods that have been lost to time.
In 628 AD, was solved by Brahmagupta, who gave his method.
In 1150, was solved by Bhāskara II with a general method.
In 1657, was given as a challenge problem by Fermat.
In 1659, Johann Rahn wrote a book that included the method. In 1668, John Pell translated Rahn's book.
Euler thought Pell solved the problem, so he named the Pell equation. 
Ignore them. This Demonstration uses the method developed by Lagrange in 1766. His method uses the convergents of continued fractions. For , are the first 12 convergents, each fraction leading to a closer approximation. Of these, give solutions, the last being . Lagrange proved that the convergents would always eventually yield solutions. Lagrange also proved that the method by Bhāskara II always works.[less]