The equation x2+y2=z2x^2 + y^2 = z^2 has infinitely many solutions over the real numbers. Pick any x,y0x, y \geq 0, compute z=x2+y2z = \sqrt{x^2 + y^2}, and you have one. The equation describes the Pythagorean theorem, and every right triangle gives a solution.

Now ask: are there solutions where x,y,zx, y, z are all whole numbers?

Yes. The smallest is (3,4,5)(3, 4, 5): 9+16=259 + 16 = 25. There are infinitely many others — (5,12,13)(5, 12, 13), (8,15,17)(8, 15, 17), (7,24,25)(7, 24, 25), (20,21,29)(20, 21, 29). They’re called Pythagorean triples, and they were known to the Babylonians 4000 years ago.

But notice what happened. Over the reals, the equation has infinitely many solutions and they’re easy to describe (a half-plane or so). Over the integers, the equation still has infinitely many solutions, but describing them takes work. And as soon as you change the equation slightly — say, to x3+y3=z3x^3 + y^3 = z^3 — the integer behavior becomes radically different. As Fermat’s Last Theorem tells us, xn+yn=znx^n + y^n = z^n has no positive integer solutions for n3n \geq 3. The simple change from squares to cubes destroys all integer solutions.

This is the world of Diophantine equations — polynomial equations where solutions must be integers (or sometimes rationals). The restriction sounds modest. It’s not. Diophantine equations have been one of the most active areas of mathematics for two thousand years, and many of their hardest problems remain open today.

This article is about what these equations are, why they’re so hard, and what makes them central to modern number theory.

The basic problem

A Diophantine equation is a polynomial equation in several variables, with integer coefficients, where you ask for solutions in integers (or sometimes rationals). The simplest examples:

  • 3x+5y=73x + 5y = 7 — a linear Diophantine equation.
  • x2+y2=z2x^2 + y^2 = z^2 — Pythagorean triples.
  • x22y2=1x^2 - 2y^2 = 1 — Pell’s equation.
  • xn+yn=znx^n + y^n = z^n for n3n \geq 3 — Fermat’s equation.
  • y2=x3+ax+by^2 = x^3 + ax + b — elliptic curves.

For each, the question is: do integer solutions exist? If so, how many? Can we describe them all?

Linear Diophantine equations are easy. Anything beyond linear is hard.

Linear case

The equation ax+by=cax + by = c has integer solutions if and only if gcd(a,b)\gcd(a, b) divides cc. When solutions exist, there are infinitely many, parameterized by an integer parameter:

x=x0+b/dt,y=y0a/dtx = x_0 + b/d \cdot t, \quad y = y_0 - a/d \cdot t

where d=gcd(a,b)d = \gcd(a, b), (x0,y0)(x_0, y_0) is any particular solution, and tZt \in \mathbb{Z} ranges over the integers.

Finding (x0,y0)(x_0, y_0) is a job for the extended Euclidean algorithm, which computes gcd(a,b)\gcd(a, b) along with integer coefficients realizing it.

This case is fully understood. Linear Diophantine equations are solved.

Quadratic case

For quadratic Diophantine equations, things get interesting. The Pythagorean equation x2+y2=z2x^2 + y^2 = z^2 has a complete parameterization:

x=m2n2,y=2mn,z=m2+n2x = m^2 - n^2, \quad y = 2mn, \quad z = m^2 + n^2

for any positive integers m>nm > n with gcd(m,n)=1\gcd(m, n) = 1 and exactly one even. These are the primitive Pythagorean triples; all others are integer multiples.

This formula was known to Euclid. It gives an infinite parameterized family.

Pell’s equation x2Ny2=1x^2 - Ny^2 = 1 (where NN is a positive non-square integer) is more subtle but also fully solved. It has infinitely many integer solutions, generated from a fundamental solution by repeated multiplication. The continued fraction of N\sqrt{N} gives the fundamental solution. (See our continued fractions piece.)

Other quadratic forms can be more complex. The general theory — Gauss’s Disquisitiones Arithmeticae (1801) — classifies them via the theory of quadratic forms and class numbers.

Cubic case: elliptic curves

Cubic Diophantine equations open the door to one of the deepest areas of modern mathematics. The equation y2=x3+ax+by^2 = x^3 + ax + b defines an elliptic curve. Finding rational or integer points on elliptic curves is a famously hard problem.

Highlights of what’s known:

  • Mordell’s theorem (1922): the rational points on an elliptic curve form a finitely generated group.
  • Siegel’s theorem (1929): an elliptic curve has only finitely many integer points.
  • Birch–Swinnerton-Dyer conjecture: relates the number of rational points to analytic properties of the curve. One of the Millennium Prize Problems, still open.

Elliptic curves are central to modern number theory. They’re the bridge that Andrew Wiles used to prove Fermat’s Last Theorem — connecting modular forms to elliptic curves via the modularity theorem.

They’re also central to modern cryptography: elliptic curve cryptography (ECC) is the standard for securing internet communications, replacing older RSA-based systems for many applications. Read our cryptography piece for more.

Higher degrees: the wilderness

For Diophantine equations of degree 4 or higher, there are far fewer general results.

Some deep theorems exist:

  • Faltings’s theorem (1983, formerly Mordell’s conjecture): A smooth algebraic curve of genus 2\geq 2 has only finitely many rational points. This won Faltings the Fields Medal. It implies that for n4n \geq 4, the equation xn+yn=znx^n + y^n = z^n has only finitely many primitive solutions — but doesn’t rule out their existence (which Wiles did, for these specific equations).

But many basic questions remain stubbornly open:

  • Are there infinitely many integer points on y2=x3+17y^2 = x^3 + 17? Unknown in general for many cubic curves.
  • Does the Erdős–Straus conjecture hold? It says every fraction 4/n4/n can be written as a sum of three unit fractions 1/a+1/b+1/c1/a + 1/b + 1/c. Verified for small nn, unproven in general.
  • Are there integer solutions to a4+b4+c4=d4a^4 + b^4 + c^4 = d^4? Yes — Noam Elkies found one in 1988: 958004+2175194+4145604=422481495800^4 + 217519^4 + 414560^4 = 422481^4. But the existence wasn’t known before then, and Euler had conjectured no solutions exist.

The general landscape: a few deep general theorems, plus a vast array of specific open questions.

Hilbert’s tenth problem

In 1900, David Hilbert listed 23 open problems for the 20th century. The tenth problem asked:

Is there a general algorithm that, given a Diophantine equation, decides whether it has integer solutions?

Hilbert’s question was about decidability: not necessarily finding solutions, but just deciding existence.

In 1970, Yuri Matiyasevich, building on work by Martin Davis, Hilary Putnam, and Julia Robinson, proved the answer is no. There is no such algorithm. The problem is undecidable.

The proof is striking: Matiyasevich showed that any computable set can be expressed as the set of integer solutions to some Diophantine equation. Since some computable sets correspond to undecidable problems (the halting problem, for example), Diophantine solvability inherits this undecidability.

This is one of the most consequential results of 20th-century logic. It says that the question “does this equation have integer solutions?” is, in full generality, outside the reach of algorithms. Some Diophantine equations resist all systematic methods; their solvability or unsolvability cannot be determined by any procedure, no matter how clever.

This is closely related to Gödel’s incompleteness theorem and Turing’s halting problem — three foundational impossibility results from 20th-century logic.

Why are Diophantine equations hard?

The reason Diophantine equations are systematically hard is that the integers are an unfriendly setting for algebraic problems.

Over the real or complex numbers, you have continuity, calculus, and topology. You can use Newton’s method to find solutions. You can apply the intermediate value theorem to prove solutions exist. The fundamental theorem of algebra guarantees roots of every polynomial.

Over the integers, none of this works. Integer solutions are discrete — they don’t move continuously, so you can’t use calculus. They’re local in the wrong way — adding 1 to an integer gives the next integer, but the geometric or algebraic structure can change abruptly. And they’re finite in any bounded region — but the equation might have solutions arbitrarily far out, requiring some way to certify their (non-)existence at all sizes.

The classical tools that work for Diophantine equations are:

  • Modular arithmetic: reduce the equation modulo small primes; if no solution exists modulo some prime, no integer solution exists. This often gives a quick disproof but rarely a positive proof.
  • Descent arguments: assume a solution exists, derive a smaller solution, contradiction. Used by Fermat for n=4n = 4; the basis for many modern Diophantine techniques.
  • Heights and bounds: estimate how large solutions could be, then exhaustively search. Works when bounds are computable but often they’re astronomically large.
  • Algebraic number theory: extend the integers to “ideals” in a number field, factor in the larger ring, draw conclusions in the original integers. Read our pieces on Galois theory and number theory for the broader framework.

Each technique is powerful but limited. There’s no master method.

What Diophantine equations teach

The deepest lesson is that changing the domain changes the difficulty. The same equation can be trivial over R\mathbb{R}, fully solved over C\mathbb{C}, parameterized over Q\mathbb{Q}, and undecidable over Z\mathbb{Z}. The integers are the hardest domain because they’re the most rigid.

This rigidity is also what makes integer solutions valuable in cryptography, error correction, and combinatorics. The structure that makes Diophantine equations hard to solve also makes them useful for protecting data.

For a student, Diophantine equations are an entry into deep number theory. Many specific examples lead naturally into elliptic curves, modular forms, pp-adic numbers, algebraic number theory. The Fermat-Wiles story is the dramatic version; behind it are hundreds of related problems, some solved, some open, all using the same mathematical machinery.

For a working mathematician, Diophantine equations remain one of the most active research areas. Major recent progress includes:

  • The proof of Fermat’s Last Theorem (1995).
  • Solutions to the Catalan conjecture (Mihailescu, 2002): the only solution to xpyq=1x^p - y^q = 1 with p,q2p, q \geq 2 and x,y1x, y \geq 1 is 3223=13^2 - 2^3 = 1.
  • Progress on the abc conjecture (with Mochizuki’s controversial proof attempt).
  • Massive computational progress on specific elliptic curves.
  • The Mochizuki/Joshi controversy in inter-universal Teichmüller theory — still being assessed.

These results matter not just for their specific consequences but because the techniques developed for them have applications across mathematics.

The two-thousand-year story of Diophantine equations — from Diophantus through Fibonacci through Fermat through Wiles — is one of the longest continuous research programs in mathematics. It’s still going. Many basic questions about integer solutions to polynomial equations remain open, and probably will for centuries to come.

That’s what happens when a simple-sounding question — “are there whole-number solutions?” — turns out to require essentially all of modern algebra and analysis to answer. Diophantus of Alexandria wrote down some interesting puzzles 1,800 years ago. We’re still working on them.

Frequently asked

Are all Diophantine equations hard?

Surprisingly, yes. Hilbert's tenth problem asked: is there a general algorithm to determine whether a given Diophantine equation has integer solutions? The answer, proven in 1970 by Yuri Matiyasevich, is no — the problem is undecidable. There exist specific Diophantine equations for which no algorithm can determine solvability. So 'are there integer solutions?' is, in general, not algorithmically answerable.

Why are Diophantine equations harder than algebraic equations?

Because the integers have less structure than the reals or complexes. Over the reals, you can use continuity, calculus, and analytic methods. Over the integers, those tools fail. You're stuck with combinatorial and number-theoretic arguments — congruences, divisibility, factorizations — and these give partial information rather than direct solutions. The whole subject of algebraic number theory was built to handle this difficulty.

Was Diophantus the first?

He's the first systematically known. Diophantus of Alexandria (around 250 CE) wrote Arithmetica, a 13-book treatise on solving polynomial equations in integers and rationals. Earlier mathematicians (Babylonians, Greeks, Indians) had specific examples, but Diophantus organized the subject. Pierre de Fermat famously wrote his 'Last Theorem' in the margin of his copy of Arithmetica.