# Diophantine equation

A Diophantine equation is a polynomial equation with rational coefficients for which the solutions of interest are restricted to integers or rational numbers, rather than arbitrary real or complex values.<sup>[1](https://www.uni-ulm.de/en/mawi/institute-of-pure-mathematics/teaching/wintersemester-201718/diophantine-equations/)</sup>

| Key fact | Detail |
|---|---|
| Definition | A polynomial equation with rational coefficients whose rational or integral solutions are sought<sup>[1](https://www.uni-ulm.de/en/mawi/institute-of-pure-mathematics/teaching/wintersemester-201718/diophantine-equations/)</sup> |
| Linear case | \( ax + by = c \) has integer solutions if and only if \( \gcd(a,b) \) divides \( c \)<sup>[3](https://math.gordon.edu/ntic/ntic2017/section-lin-dioph.html)</sup> |
| Congruence link | Solving the linear congruence \( ax \equiv b \pmod{n} \) is equivalent to solving the Diophantine equation \( ax + ny = b \)<sup>[4](https://math.libretexts.org/Courses/Mount_Royal_University/Higher_Arithmetic/5%3A_Diophantine_Equations/5.2_%3A_Linear_Congruences_Revisted)</sup> |
| Famous example | The Fermat equation \( x^{n} + y^{n} = z^{n} \); claimed unsolvable in nonzero integers for \( n > 2 \) by Fermat in 1637, proved by Andrew Wiles in 1994<sup>[1](https://www.uni-ulm.de/en/mawi/institute-of-pure-mathematics/teaching/wintersemester-201718/diophantine-equations/)</sup> |
| Decidability | Hilbert's tenth problem, asking for an algorithm to decide whether a Diophantine equation has an integral solution, received a negative solution from Yuri Matiyasevich in 1970<sup>[5](https://mitpress.mit.edu/9780262132954/hilberts-10th-problem/)</sup> |

## The linear case

The simplest Diophantine equations are linear in two variables, \( ax + by = c \) with \( a, b, c \) integers and \( a, b \) not both zero. The complete solvability criterion is elementary: solutions exist precisely when \( d = \gcd(a,b) \) divides \( c \).<sup>[3](https://math.gordon.edu/ntic/ntic2017/section-lin-dioph.html)</sup> When a particular solution \( (x_0, y_0) \) is known, all others follow from it by adding multiples of the reduced coefficients, a structure obtained by running the extended [Euclidean algorithm](https://www.edgepedia.org/euclidean-algorithm) to express \( \gcd(a,b) \) as a combination \( ax + by \).<sup>[6](https://www.youtube.com/watch?v=FjliV5u2IVw)</sup>

This theory is the same as the theory of linear congruences. The congruence \( ax \equiv b \pmod{n} \) has a solution exactly when \( d = \gcd(a,n) \) divides \( b \), because a solution of the congruence is nothing other than an integer pair solving \( ax + ny = b \). When solutions exist there are exactly \( d \) of them modulo \( n \), spaced \( n/d \) apart.<sup>[4](https://math.libretexts.org/Courses/Mount_Royal_University/Higher_Arithmetic/5%3A_Diophantine_Equations/5.2_%3A_Linear_Congruences_Revisted)</sup><sup> • </sup><sup>[7](https://math.gordon.edu/ntic/ntic2017/section-solve-lin-cong.html)</sup> The general integer solution of a single linear equation extends to equations in \( n \) unknowns and to systems of linear Diophantine equations.<sup>[8](https://arxiv.org/abs/math/0010134)</sup>

## History

The subject takes its name from Diophantus of Alexandria, believed to have lived in the third century, whose *Arithmetica* treated the solution of algebraic equations and problems about square and cube numbers and right-angled triangles.<sup>[2](https://mathshistory.st-andrews.ac.uk/Biographies/Diophantus/)</sup><sup> • </sup><sup>[9](https://jimclifford.ca/britannica-articles-2/a/EB.10/191678897/1083.html)</sup> Fermat famously studied Diophantus's text and wrote in its margin, in 1637, his claim that \( x^{n} + y^{n} = z^{n} \) has no integral solution with \( xyz \neq 0 \) when \( n > 2 \). This statement, [Fermat's Last Theorem](https://www.edgepedia.org/fermats-last-theorem), resisted proof for more than 300 years until [Andrew Wiles](https://www.edgepedia.org/andrew-wiles) settled it in 1994.<sup>[1](https://www.uni-ulm.de/en/mawi/institute-of-pure-mathematics/teaching/wintersemester-201718/diophantine-equations/)</sup>

Independent of the Greek tradition, Indian mathematicians developed the linear theory early. Aryabhata's text of 499 CE contains the first explicit general integral solution of \( ay + bx = c \), a method later commentators elaborated.<sup>[10](https://www.sciencedirect.com/topics/mathematics/aryabhata)</sup> [Brahmagupta](https://www.edgepedia.org/brahmagupta), head of the astronomical observatory at Ujjain, gave in 628 CE methods for indeterminate equations of the form \( ax + c = by \) and, through his composition lemma for Pell-type equations, showed how one solution of [Pell's equation](https://www.edgepedia.org/pells-equation) generates many others.<sup>[11](https://mathshistory.st-andrews.ac.uk/Biographies/Brahmagupta/)</sup><sup> • </sup><sup>[12](https://mathshistory.st-andrews.ac.uk/HistTopics/Pell/)</sup>

## Quadratic equations and Pell's equation

Diophantus examined problems related to Pell's equation, and Archimedes' cattle problem reduces to it, though there is no evidence [Archimedes](https://www.edgepedia.org/archimedes) made that connection himself.<sup>[12](https://mathshistory.st-andrews.ac.uk/HistTopics/Pell/)</sup>

## Elliptic curves and higher degrees

Degree three is where easy classification ends. A standard graduate course on the subject builds from Pell equations and ternary quadratic forms through \( p \)-adic numbers and [Diophantine approximation](https://www.edgepedia.org/diophantine-approximation), and closes with elliptic curves and Mordell's theorem on their rational points.<sup>[1](https://www.uni-ulm.de/en/mawi/institute-of-pure-mathematics/teaching/wintersemester-201718/diophantine-equations/)</sup> Records of elliptic curves over \( \mathbb{Q} \) of given rank up to 11 with minimal conductor or discriminant have been tabulated by Noam Elkies of Harvard University and Mark Watkins.<sup>[14](https://abel.math.harvard.edu/~elkies/compnt.html)</sup>

Modern Diophantine approximation supplies upper bounds for the size of solutions of broad equation classes, using tools such as linear forms in logarithms of algebraic numbers and the hypergeometric method; combined with computation, these bounds make it possible to determine all solutions of a given equation.<sup>[15](https://web.math.pmf.unizg.hr/~duje/diophantine.html)</sup><sup> • </sup><sup>[16](https://ntrg.math.unideb.hu/research.html)</sup> One proposed research program orders all polynomial Diophantine equations by a defined notion of size and solves them in that order, starting from the smallest.<sup>[17](https://arxiv.org/abs/2108.08705)</sup>

## Undecidability

In 1900 Hilbert asked for a method, in modern terms an algorithm, to decide for an arbitrary Diophantine equation whether it has an integral solution. [Yuri Matiyasevich](https://www.edgepedia.org/yuri-matiyasevich), head of the Laboratory of Mathematical Logic at the [Steklov Institute of Mathematics](https://www.edgepedia.org/steklov-institute-of-mathematics) in [Saint Petersburg](https://www.edgepedia.org/saint-petersburg), resolved the problem negatively in 1970: no such algorithm exists.<sup>[5](https://mitpress.mit.edu/9780262132954/hilberts-10th-problem/)</sup> The negative solution is counted among the great mathematical results of the twentieth century.<sup>[5](https://mitpress.mit.edu/9780262132954/hilberts-10th-problem/)</sup> Undecidability persists over richer coefficient rings: Matiyasevich and Zhi-Wei Sun proved that there is no algorithm to decide whether a polynomial equation \( P(z_1, \ldots, z_{20}) = 0 \) with integer coefficients is solvable over the Gaussian integers \( \mathbb{Z}[i] \), with 20 unknowns sufficing.<sup>[18](https://arxiv.org/abs/2510.18794)</sup>

## Applications

Linear Diophantine equations and the congruence theory built on them are foundational for public-key cryptography, alongside the extended Euclidean algorithm, modular inverses, and the Chinese Remainder Theorem.<sup>[19](https://amupie.amu.edu.pl/304/details)</sup> Higher-degree Diophantine equations have also been proposed directly as cryptographic primitives: one key-exchange scheme uses one-way functions built from higher-order Diophantine equations as public keys, with a trapdoor allowing the recipient to recover the secret.<sup>[20](https://arxiv.org/abs/1103.3742)</sup> Systems of linear Diophantine equations, solvable in polynomial time, have been used in approaches to the graph isomorphism problem.<sup>[21](https://arxiv.org/abs/1607.04287)</sup>

## References

1. [Diophantine Equations, Universität Ulm lecture description](https://www.uni-ulm.de/en/mawi/institute-of-pure-mathematics/teaching/wintersemester-201718/diophantine-equations/)
2. [Diophantus (200–284), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Biographies/Diophantus/)
3. [NTIC: Linear Diophantine Equations, Gordon College](https://math.gordon.edu/ntic/ntic2017/section-lin-dioph.html)
4. [Linear Congruences Revisited, Mathematics LibreTexts](https://math.libretexts.org/Courses/Mount_Royal_University/Higher_Arithmetic/5%3A_Diophantine_Equations/5.2_%3A_Linear_Congruences_Revisted)
5. [Hilbert's Tenth Problem, MIT Press](https://mitpress.mit.edu/9780262132954/hilberts-10th-problem/)
6. [Diophantine Equation: ax+by=gcd(a,b), Socratica video](https://www.youtube.com/watch?v=FjliV5u2IVw)
7. [NTIC: Solving Linear Congruences, Gordon College](https://math.gordon.edu/ntic/ntic2017/section-solve-lin-cong.html)
8. [Integer Algorithms to Solve Diophantine Linear Equations and Systems, arXiv](https://arxiv.org/abs/math/0010134)
9. [Diophantine Problems, Encyclopædia Britannica 5th ed. (1815)](https://jimclifford.ca/britannica-articles-2/a/EB.10/191678897/1083.html)
10. [Aryabhata, ScienceDirect Topics overview](https://www.sciencedirect.com/topics/mathematics/aryabhata)
11. [Brahmagupta (598–670), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Biographies/Brahmagupta/)
12. [Pell's Equation, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/HistTopics/Pell/)
13. [Number Theory and Cryptography, NYU course notes](https://math.nyu.edu/~hausner/division.pdf)
14. [Algorithmic Number Theory: Tables and Links, Noam Elkies, Harvard University](https://abel.math.harvard.edu/~elkies/compnt.html)
15. [Diophantine equations research page, University of Zagreb](https://web.math.pmf.unizg.hr/~duje/diophantine.html)
16. [Number Theory Research Group, University of Debrecen](https://ntrg.math.unideb.hu/research.html)
17. [Diophantine equations: a systematic approach, arXiv](https://arxiv.org/abs/2108.08705)
18. [Undecidability on Diophantine equations over Z[i] with 20 unknowns, Matiyasevich and Sun, arXiv](https://arxiv.org/abs/2510.18794)
19. [Introduction to Number Theory, AMU-PIE Platform](https://amupie.amu.edu.pl/304/details)
20. [The key exchange cryptosystem used with higher order Diophantine equations, arXiv](https://arxiv.org/abs/1103.3742)
21. [Linear Diophantine Equations, Group CSPs, and Graph Isomorphism, arXiv](https://arxiv.org/abs/1607.04287)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: Physical world and mathematics › Mathematics and statistics › Numbers and algebra › Number theory › Diophantine problems and approximation › Linear and additive Diophantine equations

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/diophantine-equation
