Pell Equation

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram CDF Player or other Wolfram Language products.

Requires a Wolfram Notebook System

Edit on desktop, mobile and cloud with any Wolfram Language product.

Why is the integer equation called the Pell equation?


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. [1]

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.


Contributed by: Ed Pegg Jr (March 2016)
Open content licensed under CC BY-NC-SA




[1] Wikipedia. "Pell's Equation." (Mar 2, 2016)'s_equation.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.