Diophantine Equations — Pell's Equation and Thue-Mahler

⚡ Key Takeaways

Pell's equation x2−Dy2=1x^2 - D y^2 = 1 (for non-square D>0D > 0) always has infinitely many integer solutions generated by a fundamental unit. The Thue–Mahler equation F(x,y)=m∏piziF(x,y) = m \prod p_i^{z_i} for a binary form FF of degree ≥3\ge 3 has only finitely many solutions, a deep effective-finiteness result. Both lie at the heart of Diophantine analysis, connecting algebraic number theory, continued fractions, and transcendence theory. Pell: Brahmagupta (628), Bhāskara II (1150), Lagrange (1768); Thue (1909), Mahler (1933), Baker (1968).

💡 The Core Insight

The number of integer solutions to F(x,y)=NF(x,y)=N is controlled by the degree of the binary form FF over Z\mathbb{Z}:

  • Degree 1 (linear): infinitely many, parametrized by a line.
  • Degree 2 (Pell/conic): either none, finitely many, or an infinite group — the latter when FF represents a norm form of a real quadratic field, where Dirichlet's unit theorem injects an infinite cyclic unit group.
  • Degree ≥3\ge 3 (Thue): always finitely many, because a solution would force x/yx/y to approximate an algebraic number of degree ≥3\ge 3 too well, contradicting the Thue–Siegel–Roth theorem.

Mahler's extension allows the right-hand side to range over SS-units (numbers built from a fixed finite prime set), preserving finiteness. The bridge from finite to computable is Baker's lower bound on linear forms in logarithms.

Formal Statement

DefinitionPell's equation and its negative form

Let DD be a positive integer that is not a perfect square. The (positive) Pell equation is

1
x2−Dy2=1,x,y∈Z.\quad x^2 - D y^2 = 1, \qquad x,y \in \mathbb{Z}.

Derivation hint: this is the norm equation NK/Q(x+yD)=1N_{K/\mathbb{Q}}(x+y\sqrt{D})=1 in the order Z[D]⊂K=Q(D)\mathbb{Z}[\sqrt D]\subset K=\mathbb{Q}(\sqrt D). The negative Pell equation is x2−Dy2=−1x^2 - Dy^2 = -1, solvable only for certain DD. The pair (x,y)(x,y) corresponds to the algebraic number α=x+yD\alpha = x + y\sqrt{D} with norm

2
N(α)=(x+yD)(x−yD)=x2−Dy2.\quad N(\alpha) = (x+y\sqrt D)(x-y\sqrt D) = x^2 - Dy^2.

Derivation hint: the norm of a+bDa+b\sqrt D in Q(D)\mathbb{Q}(\sqrt D) is the product of its two Galois conjugates a±bDa\pm b\sqrt D.

TheoremLagrange, 1768 — Structure of solutions to Pell

For every non-square D>0D>0, equation [1] has infinitely many solutions in positive integers. There is a unique fundamental solution (x1,y1)(x_1,y_1) with x1,y1>0x_1,y_1>0 minimal, and every solution (xn,yn)(x_n,y_n) with xn,yn≥0x_n,y_n\ge 0 is given by

3
xn+ynD=(x1+y1D) n,n=0,1,2,…\quad x_n + y_n\sqrt D = (x_1 + y_1\sqrt D)^{\,n}, \qquad n = 0,1,2,\dots

Derivation hint: the solutions with N=1N=1 form a subgroup of the unit group OK×\mathcal{O}_K^\times; by Dirichlet's unit theorem this group is {±1}×⟨ε⟩\{\pm 1\}\times \langle \varepsilon \rangle with ε\varepsilon the fundamental unit, and the N=1N=1 solutions are powers of ε\varepsilon or ε2\varepsilon^2.

DefinitionBinary form and the Thue equation

A binary form of degree nn over Z\mathbb{Z} is a homogeneous polynomial

4
F(x,y)=a0xn+a1xn−1y+⋯+anyn=a0∏i=1n(x−αiy),\quad F(x,y) = a_0 x^n + a_1 x^{n-1}y + \cdots + a_n y^n = a_0\prod_{i=1}^{n}(x - \alpha_i y),

Derivation hint: factor the dehomogenized polynomial a0∏(t−αi)a_0\prod (t-\alpha_i) with roots αi∈Q‾\alpha_i\in\overline{\mathbb{Q}}, then rehomogenize by t=x/yt=x/y and multiply by yny^n. Given a nonzero integer mm, the Thue equation is F(x,y)=mF(x,y)=m. We require FF irreducible over Q\mathbb{Q} of degree n≥3n\ge 3 (equivalently, distinct roots αi\alpha_i, none rational).

DefinitionThe Thue–Mahler equation

Fix a finite set of primes S={p1,…,ps}S = \{p_1,\dots,p_s\} and a nonzero integer mm. The Thue–Mahler equation asks for integers x,yx,y (with gcd⁡(x,y)=1\gcd(x,y)=1) and exponents zi≥0z_i \ge 0 such that

5
F(x,y)=m p1z1p2z2⋯pszs,\quad F(x,y) = m\, p_1^{z_1}p_2^{z_2}\cdots p_s^{z_s},

Derivation hint: replace the fixed right-hand side mm of the Thue equation by all SS-units times mm; equivalently F(x,y)F(x,y) is an SS-unit up to the factor mm. Here FF is again an irreducible binary form of degree n≥3n\ge 3.

TheoremThue 1909; Mahler 1933 — Finiteness

If FF is an irreducible binary form of degree n≥3n\ge 3: 1. (Thue) The Thue equation F(x,y)=mF(x,y)=m has only finitely many integer solutions. 2. (Mahler) The Thue–Mahler equation [5] has only finitely many solutions (x,y,z1,…,zs)(x,y,z_1,\dots,z_s) with gcd⁡(x,y)=1\gcd(x,y)=1. By Baker's method (1968) both solution sets are effectively computable: there is an explicit bound on max⁡(∣x∣,∣y∣)\max(|x|,|y|) and on each ziz_i.

Figure
Negative curvature explains the dichotomy: a degree-2 conic carries an infinite group of integer points (Pell), while a degree-≥3 curve has only finitely many
Degree 2: Pell hyperbola x² − Dy² = 1 ε ε² ε³… infinitely many integer points (a group) Degree ≥ 3: Thue curve F(x,y)=m only finitely many integer points genus 0 / unit group acts good rational approx forbidden (Roth)

Why It Holds / Derivation

ProofExistence of a nontrivial Pell solution (Dirichlet pigeonhole)

We show x2−Dy2=1x^2-Dy^2=1 has a solution with y≠0y\ne 0.

Step 1 — Infinitely many small norms. By Dirichlet's approximation theorem, for every QQ there exist integers p,qp,q with 1≤q≤Q1\le q\le Q and

6
∣p−qD∣<1Q≤1q.\quad \left| p - q\sqrt D \right| < \frac{1}{Q} \le \frac1q .

Derivation hint: pigeonhole the Q+1Q+1 fractional parts {qD}\{q\sqrt D\}, q=0,…,Qq=0,\dots,Q, into QQ subintervals of [0,1)[0,1).

Step 2 — Bounded norm. Then ∣p+qD∣≤∣p−qD∣+2qD<1q+2qD|p+q\sqrt D| \le |p-q\sqrt D| + 2q\sqrt D < \tfrac1q + 2q\sqrt D, so

7
∣p2−Dq2∣=∣p−qD∣ ∣p+qD∣<1q(1q+2qD)<1+2D.\quad |p^2 - Dq^2| = |p-q\sqrt D|\,|p+q\sqrt D| < \frac1q\left(\frac1q + 2q\sqrt D\right) < 1 + 2\sqrt D.

Derivation hint: multiply the two factors of the norm and use the bounds from [6].

Step 3 — A repeated value. Since infinitely many (p,q)(p,q) give ∣p2−Dq2∣<1+2D|p^2-Dq^2|<1+2\sqrt D, some fixed nonzero integer kk with ∣k∣<1+2D|k|<1+2\sqrt D is attained infinitely often. Among those, two distinct solutions (p1,q1),(p2,q2)(p_1,q_1),(p_2,q_2) agree modulo ∣k∣|k| in both coordinates.

Step 4 — Division in Z[D]\mathbb{Z}[\sqrt D]. Form the quotient

8
p1+q1Dp2+q2D=(p1+q1D)(p2−q2D)k=X+YD,\quad \frac{p_1+q_1\sqrt D}{p_2+q_2\sqrt D} = \frac{(p_1+q_1\sqrt D)(p_2-q_2\sqrt D)}{k} = X + Y\sqrt D,

Derivation hint: rationalize the denominator; the congruences from Step 3 force X,Y∈ZX,Y\in\mathbb{Z}, and the norm is multiplicative so N(X+YD)=k/k=1N(X+Y\sqrt D)=k/k=1. This (X,Y)(X,Y) solves Pell's equation; one checks Y≠0Y\ne 0 (else p1q2=p2q1p_1q_2=p_2q_1 with distinct primitive solutions, impossible). ■\blacksquare

∎
ProofFiniteness for Thue — sketch via Roth's theorem

Step 1 — Approximation reformulation. Suppose F(x,y)=mF(x,y)=m with ∣y∣|y| large. Factor F(x,y)=a0∏i(x−αiy)F(x,y)=a_0\prod_i(x-\alpha_i y). Then

9
∏i=1n∣xy−αi∣=∣m∣∣a0∣ ∣y∣n.\quad \prod_{i=1}^n \left| \frac{x}{y} - \alpha_i \right| = \frac{|m|}{|a_0|\,|y|^n}.

Derivation hint: divide F(x,y)=mF(x,y)=m by yny^n and use the factorization [4].

Step 2 — One factor is tiny. Let α=αj\alpha = \alpha_j be the root closest to x/yx/y. The other factors ∣x/y−αi∣|x/y - \alpha_i| are bounded below by a constant once x/yx/y is near α\alpha, so

10
∣xy−α∣≤C∣y∣n=C∣y∣n.\quad \left| \frac{x}{y} - \alpha \right| \le \frac{C}{|y|^n} = \frac{C}{|y|^{n}}.

Derivation hint: the product [9] is ≍∣y∣−n\asymp |y|^{-n}; isolating the smallest factor and bounding the rest below by a constant gives the single-factor bound.

Step 3 — Roth's theorem. Since α\alpha is algebraic of degree n≥3n\ge 3, Roth's theorem states that for any ϵ>0\epsilon>0 only finitely many rationals satisfy ∣α−x/y∣<∣y∣−2−ϵ|\alpha - x/y| < |y|^{-2-\epsilon}. As n≥3>2n \ge 3 > 2, inequality [10] is stronger than Roth allows for all but finitely many yy.

11
#{(x,y):F(x,y)=m}<∞.\quad \#\{(x,y): F(x,y)=m\} < \infty.

Derivation hint: [10] contradicts Roth's bound ∣α−x/y∣≥c(ϵ)∣y∣−2−ϵ|\alpha-x/y|\ge c(\epsilon)|y|^{-2-\epsilon} for large ∣y∣|y|; only finitely many yy survive, each with finitely many xx. Mahler's extension applies the same machinery in the pp-adic completions Qp\mathbb{Q}_p for p∈Sp\in S, using the pp-adic Roth (Ridout) theorem, to handle the SS-unit right-hand side. ■\blacksquare

∎
⚠️ Roth gives finiteness but not effectivity

The Thue–Roth proof above is non-effective: Roth's theorem produces no computable bound on the size of solutions. To actually solve a Thue or Thue–Mahler equation one must replace Roth by Baker's theory of linear forms in logarithms (and its pp-adic version), which yields explicit bounds like max⁡(∣x∣,∣y∣)<exp⁡exp⁡exp⁡(const involving n,H(F),S)\max(|x|,|y|) < \exp\exp\exp(\text{const involving } n, H(F), S). These triple-exponential bounds are then reduced to practicality by LLL lattice reduction and continued-fraction sieving.

mathematician · Axel Thue & Alan Baker | 1863–1922; 1939–2018

Axel Thue (Norwegian) proved in 1909 that an algebraic number of degree nn cannot be approximated by rationals to order better than n/2+1n/2 + 1, breaking Liouville's bound nn and immediately yielding finiteness of solutions to F(x,y)=mF(x,y)=m. His method was non-effective. Carl Ludwig Siegel sharpened the exponent (1921), and Klaus Roth reached the optimal 2+ϵ2+\epsilon (1955, Fields Medal). Kurt Mahler (1933) introduced pp-adic approximation, extending finiteness to SS-unit right-hand sides. The decisive turn to effectivity came from Alan Baker (1966–68, Fields Medal 1970), whose lower bounds for linear forms in logarithms made Thue, Thue–Mahler, and many Diophantine equations algorithmically solvable.

Building Intuition

🧠 Pell as a unit group; Thue as forbidden approximation

Think of x+yDx+y\sqrt D as a point in the ring Z[D]\mathbb{Z}[\sqrt D]. Multiplying two norm-1 elements gives another norm-1 element — so solutions multiply. The smallest solution ε=x1+y1D\varepsilon = x_1+y_1\sqrt D is like a "rotation generator": its powers march off to infinity along the hyperbola, spaced multiplicatively. That's why solutions grow exponentially and never stop. For Thue, picture the real roots αi\alpha_i of F(t,1)F(t,1) on the number line. A solution F(x,y)=mF(x,y)=m forces the rational x/yx/y to hug one of these algebraic irrationals abnormally tightly — tighter than 1/y21/y^2. But irrational algebraic numbers of degree ≥3\ge 3 are "approximation-resistant" (Roth): they refuse to be approximated better than 1/y2+ϵ1/y^{2+\epsilon}. So only a few small yy can sneak through. Degree 2 escapes this because its roots are quadratic irrationals whose continued fractions are periodic — generating infinitely many good approximations, which is exactly the Pell solution stream.

Worked Examples

ExampleSolving x2−13y2=1x^2 - 13 y^2 = 1 by continued fractions

Given: D=13D = 13, find the fundamental solution.

Step 1 — Continued fraction of 13\sqrt{13}. Compute 13=[3;1,1,1,1,6‾]\sqrt{13} = [3;\overline{1,1,1,1,6}] (period length 5, which is odd).

Step 2 — Convergents. Build the convergents pk/qkp_k/q_k from the partial quotients 3,1,1,1,1,6,1,1,1,1,6,…3,1,1,1,1,6,1,1,1,1,6,\dots:

kkaka_kpkp_kqkq_k
0331
1141
2172
31113
41185
5611933
6113738
7125671
81393109
91649180

Step 3 — Use the right convergent. Since the period is odd (length 5), the convergent at index ℓ−1=4\ell-1=4 gives p2−Dq2=−1p^2-Dq^2 = -1: indeed 182−13⋅52=324−325=−118^2 - 13\cdot 5^2 = 324 - 325 = -1. So the negative Pell equation is solved by (18,5)(18,5).

Step 4 — Get +1+1 by squaring. The convergent at index 2ℓ−1=92\ell-1 = 9, namely (649,180)(649,180), satisfies 6492−13⋅1802=421201−421200=1649^2 - 13\cdot 180^2 = 421201 - 421200 = 1.

(x1,y1)=(649, 180),6492−13⋅1802=1\boxed{(x_1,y_1) = (649,\ 180), \quad 649^2 - 13\cdot 180^2 = 1}

(Note the explosive growth: D=13D=13 has a tiny fundamental solution compared with D=61D=61 whose fundamental xx is 1,766,319,0491{,}766{,}319{,}049.)

ExampleA Thue equation: x3−2y3=1x^3 - 2y^3 = 1

Given: the cubic Thue equation F(x,y)=x3−2y3=1F(x,y)=x^3-2y^3=1. The form factors as ∏(x−αiy)\prod(x-\alpha_i y) with α1=21/3\alpha_1 = 2^{1/3} and two complex roots.

Step 1 — Connection to units of Q(21/3)\mathbb{Q}(2^{1/3}). Solutions correspond to elements x−21/3yx - 2^{1/3}y of norm 1 in Z[21/3]\mathbb{Z}[2^{1/3}]. The unit group has rank 1 (one real, one complex pair → r1+r2−1=1+1−1=1r_1+r_2-1=1+1-1=1), with fundamental unit η=21/3−1\eta = 2^{1/3}-1.

Step 2 — Search small values. Test:

  • (x,y)=(1,0)(x,y)=(1,0): 1−0=11 - 0 = 1 ✓
  • (x,y)=(−1,−1)(x,y)=(-1,-1): (−1)3−2(−1)3=−1+2=1(-1)^3 - 2(-1)^3 = -1 + 2 = 1 ✓
  • (x,y)=(1,1)(x,y)=(1,1) would give 1−2=−11-2 = -1, no.

Step 3 — Baker bound + reduction. Baker's linear-forms bound caps ∣y∣|y| at an astronomically large but explicit value; LLL reduction collapses it to ∣y∣≤|y|\le a few, and exhaustive search confirms no others.

Integer solutions: (x,y)=(1,0) and (−1,−1) only\boxed{\text{Integer solutions: } (x,y) = (1,0) \text{ and } (-1,-1) \text{ only}}

(Compare the Thue–Mahler version x3−2y3=7zx^3-2y^3 = 7^z, which would also have finitely many solutions, found by the same effective machinery with pp-adic Baker bounds.)

Common Misconceptions

⚠️ Frequent errors
  • "Pell's equation is due to Pell." John Pell never worked on it; Euler misattributed it. The Indian mathematicians Brahmagupta and Bhāskara II had a complete algorithm (the chakravala) centuries before Europe.
  • "The negative Pell equation x2−Dy2=−1x^2-Dy^2=-1 always has a solution." It is solvable iff the continued fraction of D\sqrt D has odd period (equivalently a constraint on the fundamental unit's norm). For D=3D=3 it has none, while for D=2D=2 it does (12−2⋅12=−11^2-2\cdot1^2=-1).
  • "Thue's theorem tells you the solutions." It only proves they are finite (and Roth's version is non-effective). Finding them requires Baker's method.
  • "All quadratic Diophantine equations are easy." General quadratics ax2+bxy+cy2+⋯=nax^2+bxy+cy^2+\dots = n reduce to Pell only after handling the discriminant; representation by an indefinite form depends on class group structure and may have no solutions at all.
CounterexampleDegree matters: x2−2y2=1x^2 - 2y^2 = 1 vs x3−2y3=1x^3 - 2y^3 = 1

The conic x2−2y2=1x^2-2y^2=1 has infinitely many solutions: (3,2),(17,12),(99,70),…(3,2),(17,12),(99,70),\dots, generated by (3+22)n(3+2\sqrt2)^n. Drop the same right-hand side onto the cubic x3−2y3=1x^3-2y^3=1 and you get only (1,0)(1,0) and (−1,−1)(-1,-1). The single increment in degree converts an infinite group into a finite set — a vivid demonstration that the degree-2/degree-3 boundary is the true watershed of binary Diophantine analysis, exactly mirroring genus 0 (rational) versus the rigidity forced by Roth.

Connections

connection · Where Pell and Thue–Mahler sit

Pell's equation is the norm-1 equation for the order Z[D]\mathbb{Z}[\sqrt D], so it is inseparable from Dirichlet's Unit Theorem (its solutions are the units) and from Continued Fractions (the algorithm that produces the fundamental unit). The size of the fundamental solution measures the regulator of the real quadratic field, linking to the Class Number Formula. Thue–Mahler equations reduce, via the factorization F(x,y)=∏(x−αiy)F(x,y)=\prod(x-\alpha_i y), to SS-unit equations u+v=1u + v = 1 in number fields, which are themselves solved by Baker's Theorem on Linear Forms in Logarithms. Both feed into the general theory of Integral Points on Algebraic Curves (Siegel's theorem) and into the resolution of Mordell Equation y2=x3+ky^2=x^3+k and elliptic equations. The conceptual divide — genus 0 with infinitely many points vs higher genus with finitely many — anticipates Faltings' Theorem (Mordell conjecture) for curves of genus ≥2\ge 2.

Real-World Applications

🔬 Concrete uses

Historical Development

⏳ History
- 628 CE — Brahmagupta discovers the bhāvanā (composition) identity (x12−Dy12)(x22−Dy22)=(x1x2+Dy1y2)2−D(x1y2+x2y1)2 (x_1^2-Dy_1^2)(x_2^2-Dy_2^2) = (x_1x_2+Dy_1y_2)^2 - D(x_1y_2+x_2y_1)^2 , the multiplicative law for Pell solutions.
- 1150 — Bhāskara II perfects the chakravala (cyclic) algorithm, solving cases like x2−61y2=1x^2-61y^2=1 centuries before Europe.
- 1657 — Fermat challenges British mathematicians to solve x2−Dy2=1x^2-Dy^2=1; Brouncker and Wallis respond with a method essentially equivalent to continued fractions.
- 1768 — Lagrange gives the first complete and rigorous theory via continued fractions, proving infinitude and the structure of solutions.
- 1801 — Gauss (Disquisitiones Arithmeticae) embeds Pell in the general theory of binary quadratic forms and the class group.
- 1844 — Liouville proves algebraic numbers are poorly approximable to order ≤n\le n, the seed of the Thue method.
- 1909 — Axel Thue improves the exponent to n/2+1n/2+1, deducing finiteness for F(x,y)=mF(x,y)=m, deg⁡F≥3\deg F\ge 3.
- 1921–1955 — Siegel, Dyson, Roth sharpen the approximation exponent to the optimal 2+ϵ2+\epsilon (Roth's theorem, 1955).
- 1933 — Mahler introduces pp-adic approximation and proves finiteness of the Thue–Mahler equation [5].
- 1966–1968 — Alan Baker establishes effective lower bounds for linear forms in logarithms, making Thue and Thue–Mahler effectively solvable; later refined pp-adically by Coates, Yu, and others.
- 1989 — Tzanakis & de Weger publish the practical LLL-based algorithm for Thue equations, extended to Thue–Mahler in the 1990s.

Subtleties & Limits

open-problem · Open and hard frontiers
  • Size of the fundamental Pell solution. No useful general upper bound on x1x_1 in terms of DD is known; it can be as large as exp⁡(Dlog⁡D)\exp(\sqrt D \log D) (relating to small regulators / large class numbers). The distribution of regulators and the proportion of DD for which the negative Pell equation is solvable (conjectured density due to Stevenhagen) remains only partially proven.
  • Effective bounds remain enormous. Baker-type bounds for Thue–Mahler are towers of exponentials in the number of primes ss and the height of FF; reducing them to polynomial size is open.
  • Higher-dimensional analogues. Norm-form and discriminant-form equations (Schmidt, Győry) generalize Thue–Mahler, but optimal effective constants are unknown.
  • Uniform bounds (number of solutions). Whether the number of solutions to F(x,y)=mF(x,y)=m can be bounded purely in terms of deg⁡F\deg F (independent of the coefficients of FF) is subtle; strong results exist (Bombieri–Schmidt, Stewart) but a sharp uniform theory is incomplete.
  • The abcabc connection. A strong effective abcabc conjecture would immediately yield clean effective bounds for Thue–Mahler equations, bypassing Baker's towers — but abcabc itself remains unproven.

See Also

Pell's Equation · Continued Fractions · Dirichlet's Unit Theorem · Roth's Theorem on Rational Approximation · Baker's Theorem on Linear Forms in Logarithms · S-unit Equations · Binary Quadratic Forms · Mordell Equation · Faltings' Theorem · Class Number Formula