By M.Xu mi KS
1. Introduction
In 1657, Pierre de Fermat challenged English mathematicians to find whole-number solutions to equations such as . The smallest solution turns out to be and , which the Indian mathematician Bhāskara II had already found in the 12th century. Equations like this are named after the English mathematician John Pell, but only because Leonhard Euler mistakenly credited Pell with a solution found by William Brouncker.
The standard Pell’s equation is any Diophantine equation generally written in the form:
where is a positive non-square integer, and we are interested in pairs of integer solutions . We can also generalise the standard equation (1) by replacing on the right-hand side with any other integer , i.e.,
The obvious solutions to equation (1) are , and these are called the trivial solutions. In this article we will show that, given one non-trivial solution, a standard Pell’s equation (1) has infinitely many different solutions, and illustrate the method to find all its solutions; we then discuss some interesting properties of those solutions.
2. Why Must Be Non-Square
As stated previously, must be non-square. If is a non-zero square number, e.g., with , then , and the only pair of squares which differ by are and , so and , yielding only the trivial solutions.
Since only and appear in Pell’s equations, changing the sign of , of , or of both does not affect the equation. Therefore every integer solution has three corresponding solutions , and , and our study can be focused on solutions where and are both positive integers, which are called non-trivial solutions.
3. New Solutions from Old
Given the example equation , two positive solutions are and , since is a square when and , where and .
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 | 9 | 19 | 33 | 51 | 73 | 99 | 129 | 163 | 201 | 243 | 289 | |
| Square? |
As another example, the equation has positive solutions , , , etc.
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 | 13 | 28 | 49 | 76 | 109 | 148 | 193 | 244 | 301 | 364 | 433 | 508 | 589 | 676 | |
| Square? |
Joseph Louis Lagrange proved that, as long as is not a perfect square, the standard Pell’s equation (1) has infinitely many distinct integer solutions. Searching by trial, as above, quickly becomes impractical, but there is a much better way to find new solutions.
Let and be two, not necessarily different, non-trivial solutions to a standard Pell’s equation, that is, . We multiply them, and obtain
This identity was first discovered by the Indian mathematician Brahmagupta around 628 AD. It gives us a new solution , since, as , we have , , and . Notice that if either of the two solutions is the trivial solution instead, say , then , so we do not obtain a new solution. Repeating this process allows us to keep finding new solutions from existing old solutions. So, given just one non-trivial solution, we can generate infinitely many other distinct non-trivial solutions.
4. The Fundamental Solution
The fundamental solution is the minimal solution among all non-trivial solutions to a standard Pell’s equation (1), meaning the solution with the smallest positive (or, equivalently, the smallest positive ). A rigorous proof of the existence of the fundamental solution to any standard Pell’s equation is not in the scope of this article. We can demonstrate some examples here, however.
The table below shows fundamental solutions to (1) for non-square from to :
| 2 | 3 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 | 2 | 9 | 5 | 8 | 3 | 19 | 10 | 7 | 649 | 15 | 4 | |
| 2 | 1 | 4 | 2 | 3 | 1 | 6 | 3 | 2 | 180 | 4 | 1 |
The fundamental solutions to standard Pell’s equations may appear random. Sometimes they may be quite large even for a small , as in some of the examples in the table below:
| 60 | 61 | 62 | 108 | 109 | 110 | |
|---|---|---|---|---|---|---|
| 31 | 1766319049 | 63 | 1351 | 158070671986249 | 21 | |
| 4 | 226153980 | 8 | 130 | 15140424455100 | 2 |
5. Finding All Solutions
We can obtain all solutions to (1) from the fundamental solution. A rigorous proof that all solutions can be found this way relies on the minimality of the fundamental solution, and is beyond the scope of this article. Here we shall demonstrate how we obtain all solutions from the fundamental solution.
5.1 Iterative Formulas
If is the fundamental solution, i.e., is the minimal positive integer pair satisfying , then
will give us all pairs of ever-increasing solutions , , , , …. For example, for with fundamental solution , the first step gives , and the next gives , matching the solutions found by trial in Section 3.
In fact all non-trivial solutions can be obtained in this iterative way. We shall rewrite the simultaneous recurrence formulas as:
where and . Sometimes we may extend the subscript down to to include the trivial solution .
The two simultaneous first-order linear recurrence formulas above can be rewritten as two separate second-order linear recurrence relations, in the sense that the sequences and appear decoupled. For :
Similarly, for , substituting from (4) gives . These formulas may be useful in situations where our interest is solely in one of the two sequences.
5.2 Closed-Form Formulas
In some other situations it may be more convenient to calculate solutions in closed form instead of using the iterative formulas above. This can be derived either from the two separate second-order recurrence formulas above, or from the simultaneous first-order recurrence relation. Here we show a quick way from the latter.
Adding times (4) to (3):
If we treat as a new sequence (of real numbers rather than only integers), then it is a geometric sequence with ratio and first term . Therefore,
Subtracting times (4) from (3):
Again, we have another geometric sequence with ratio and first term . So,
The closed-form formulas for and can be obtained by adding and subtracting (5) and (6), then dividing by and by respectively:
5.3 Properties of the Closed-Form Formulas
Note that although there is an irrational number in the closed-form formulas (7) and (8), it can be proved through mathematical induction that is always a pair of positive integers. In addition, we start with , but we can obtain the trivial solution by setting . It can be seen that is the fundamental solution. If is a negative integer instead, it can be seen that and , which is still a pair of integers satisfying the standard Pell’s equation (1), only with a negative value. Combined with the sign changes from Section 2, these formulas actually give all the solutions to a standard Pell’s equation: every solution is for some .
The term as , and this also implies that , because . Therefore, as increases, both elements of the solution pair grow exponentially. That is, for sufficiently large :
6. Approximating
From (7) and (8) we can also derive a method to approximate the irrational number with rational numbers. In fact, we can approximate it with the sequences and to any precision required. Dividing (7) by (8):
Clearly, as . That means . Here is an example of using solutions to the standard Pell’s equation to approximate :
| Decimal | Error | |||
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 |
In fact, the fractions are among the best possible rational approximations to : they appear among the convergents of the continued fraction of , which is also how fundamental solutions are usually found in practice.
7. Conclusion
Although this article has explored methods for finding all integer solutions to Pell’s equation, and their interesting properties, there remains much more to investigate. For example, a generalised Pell’s equation (2) may have no integer solutions at all, or it may have several distinct families of solutions, each combining a particular solution to (2) with the infinitely many solutions to its corresponding standard Pell’s equation (1). Why, and how? For another example, Lagrange’s proof that every standard Pell’s equation has a minimal non-trivial solution (in other words, the existence of the fundamental solution), alongside the use of continued fractions to find these fundamental solutions, offers further fascinating insights into the mathematics behind these equations.
References
Bradley, C. J. Introduction to Number Theory. United Kingdom Mathematics Trust, 2010.
Conrad, Keith. “Pell’s Equation, I.” University of Connecticut. https://kconrad.math.uconn.edu/blurbs/ugradnumthy/pelleqn1.pdf.
“Pell’s Equation.” Wikipedia, Wikimedia Foundation. https://en.wikipedia.org/wiki/Pell%27s_equation.
“Pell’s Equation and Its Importance.” Mathematics Stack Exchange. https://math.stackexchange.com/questions/583055/pells-equation-and-its-importance.





Leave a Reply