Special cases As early as 400 BC in
India and
Greece, mathematicians studied the numbers arising from the
n = 2 case of Pell's equation, x^2 - 2 y^2 = 1, and from the closely related equation x^2 - 2 y^2 = -1 because of the connection of these equations to the
square root of 2. Later,
Archimedes approximated the
square root of 3 by the rational number 1351/780. Although he did not explain his methods, this approximation may be obtained in the same way, as a solution to Pell's equation. Likewise,
Archimedes's cattle problem—an ancient
word problem about finding the number of cattle belonging to the sun god
Helios—can be solved by reformulating it as a Pell's equation. The manuscript containing the problem states that it was devised by Archimedes and recorded in a letter to
Eratosthenes, and the attribution to Archimedes is generally accepted today.
General case Around AD 250,
Diophantus considered the equation a^2 x^2 + c = y^2, where
a and
c are fixed numbers, and
x and
y are the variables to be solved for. This equation is different in form from Pell's equation but equivalent to it. Diophantus solved the equation for (
a,
c) equal to (1, 1), (1, −1), (1, 12), and (3, 9).
Al-Karaji, a 10th-century Persian mathematician, worked on similar problems to Diophantus. In Indian mathematics,
Brahmagupta discovered that (x_1^2 - Ny_1^2)(x_2^2 - Ny_2^2) = (x_1x_2 + Ny_1y_2)^2 - N(x_1y_2 + x_2y_1)^2, a form of what is now known as
Brahmagupta's identity. Using this, he was able to "compose" triples (x_1, y_1, k_1) and (x_2, y_2, k_2) that were solutions of x^2 - Ny^2 = k, to generate the new triples : (x_1x_2 + Ny_1y_2 , x_1y_2 + x_2y_1 , k_1k_2) and (x_1x_2 - Ny_1y_2 , x_1y_2 - x_2y_1 , k_1k_2). Not only did this give a way to generate infinitely many solutions to x^2 - Ny^2 = 1 starting with one solution, but also, by dividing such a composition by k_1k_2, integer or "nearly integer" solutions could often be obtained. For instance, for N = 92, Brahmagupta composed the triple (10, 1, 8) (since 10^2 - 92(1^2) = 8) with itself to get the new triple (192, 20, 64). Dividing throughout by 64 ("8" for x and y) gave the triple (24, 5/2, 1), which when composed with itself gave the desired integer solution (1151, 120, 1). Brahmagupta solved many Pell's equations with this method, proving that it gives solutions starting from an integer solution of x^2 - Ny^2 = k for
k = ±1, ±2, or ±4. The first general method for solving the Pell's equation (for all
N) was given by
Bhāskara II in 1150, extending the methods of Brahmagupta. Called the
chakravala (cyclic) method, it starts by choosing two
relatively prime integers a and b, then composing the triple (a, b, k) (that is, one which satisfies a^2 - Nb^2 = k) with the trivial triple (m, 1, m^2 - N) to get the triple \big(am + Nb, a + bm, k(m^2 - N)\big), which can be scaled down to \left(\frac{am + Nb}{k}, \frac{a + bm}{k}, \frac{m^2 - N}{k}\right). When m is chosen so that \frac{a + bm}{k} is an integer, so are the other two numbers in the triple. Among such m, the method chooses one that minimizes \frac{m^2 - N}{k} and repeats the process. This method always terminates with a solution. Bhaskara used it to give the solution
x = ,
y = to the
N = 61 case. In a letter to
Kenelm Digby,
Bernard Frénicle de Bessy said that Fermat found the smallest solution for
N up to 150 and challenged
John Wallis to solve the cases
N = 151 or 313. Both Wallis and
William Brouncker gave solutions to these problems, though Wallis suggests in a letter that the solution was due to Brouncker.
John Pell's connection with the equation is that he revised
Thomas Branker's translation of
Johann Rahn's 1659 book
Teutsche Algebra into English, with a discussion of Brouncker's solution of the equation.
Leonhard Euler mistakenly thought that this solution was due to Pell, as a result of which he named the equation after Pell. The general theory of Pell's equation, based on
continued fractions and algebraic manipulations with numbers of the form P + Q\sqrt{a}, was developed by Lagrange in 1766–1769. In particular, Lagrange gave a proof that the Brouncker–Wallis algorithm always terminates. ==Solutions==