A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Pell's Equation

Graduate Depth 79 in the knowledge graph ☐ I know this ☆ Set as goal
4topics build on this
378prerequisites beneath it
See this on the map →
Continued FractionsLinear Diophantine Equations→→Lagrange's Four-Square Theorem
pells-equation diophantine continued-fractions

Core Idea

Pell's equation x2 - Dy2 = 1 (D not a perfect square) has infinitely many integer solutions generated from a fundamental solution via the continued fraction expansion of √D. Solutions correspond to units in ℤ[√D].

Explainer

Pell's equation x² − Dy² = 1 is deceptively simple to write down, yet finding its integer solutions requires one of the most beautiful tools in number theory: continued fractions, your main prerequisite. You've studied how irrational numbers like √2 = [1; 2, 2, 2, ...] can be represented as infinite continued fractions, and how their convergents — the rational approximations you get by truncating the continued fraction — give extraordinarily good approximations to the irrational number. The connection to Pell's equation is that these same convergents produce the solutions.

To find the smallest positive solution (x₁, y₁), called the fundamental solution, expand √D as a continued fraction [a₀; a₁, a₂, ...] and compute its convergents pₖ/qₖ. The fundamental solution appears as (p_{s−1}, q_{s−1}), where s is the period of the continued fraction expansion. For D = 2: √2 = [1; 2, 2, 2, ...] with period 1, and the first convergent beyond a₀ is 3/2, giving x = 3, y = 2. Check: 3² − 2·2² = 9 − 8 = 1. ✓ For D = 3: √3 = [1; 1, 2, 1, 2, ...] with period 2, and the convergent at period end is 2/1, giving x = 2, y = 1. Check: 4 − 3 = 1. ✓

What makes Pell's equation remarkable is that from just one fundamental solution, you generate infinitely many. All solutions are given by xₙ + yₙ√D = (x₁ + y₁√D)ⁿ. This algebraic structure — multiplying together expressions in the ring ℤ[√D] — reflects the fact that solutions are units (invertible elements) in that ring: if α = x₁ + y₁√D satisfies αᾱ = 1 (where ᾱ = x₁ − y₁√D), then αⁿ also satisfies this, generating a new solution. The multiplication rule corresponds to a matrix recurrence, and the solutions grow exponentially.

The reason continued fractions find the fundamental solution goes deeper than it might appear. The convergents pₖ/qₖ of √D are the best rational approximations to √D, meaning pₖ/qₖ ≈ √D, or equivalently pₖ ≈ qₖ√D, or pₖ² ≈ Dqₖ². The error in this approximation is so small — governed by the theory of continued fractions — that pₖ² − Dqₖ² lands exactly on 1 at the right index. The entire theory of Pell's equation is in some sense a story about how well rational numbers can approximate square roots of integers, and continued fractions are the perfect language for that story.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Set Operations: Union, Intersection, and Complement → Proof by Cases → Proving by Cases and Exhaustion → Vacuous Truth and Trivial Cases → Proof by Cases (Proof by Exhaustion) → Mathematical Induction → Divisibility and Greatest Common Divisor → The Fundamental Theorem of Arithmetic → Divisibility Theory (Formal Treatment) → Bézout's Identity → Linear Diophantine Equations → Pell's Equation

Longest path: 80 steps · 378 total prerequisite topics

Prerequisites (2)

Leads To (1)