Diophantine equation



In mathematics, a Diophantine equation is an equation, typically a polynomial equation in two or more unknowns with integer coefficients, for which only integer solutions are of interest. A linear Diophantine equation equates to a constant the sum of two or more monomials, each of degree one. An exponential Diophantine equation is one in which unknowns can appear in exponents.

Diophantine problems have fewer equations than unknowns and involve finding integers that solve simultaneously all equations. As such systems of equations define algebraic curves, algebraic surfaces, or, more generally, algebraic sets, their study is a part of algebraic geometry that is called Diophantine geometry.

The word Diophantine refers to the Hellenistic mathematician of the 3rd century, Diophantus of Alexandria, who made a study of such equations and was one of the first mathematicians to introduce symbolism into algebra. The mathematical study of Diophantine problems that Diophantus initiated is now called Diophantine analysis.

While individual equations present a kind of puzzle and have been considered throughout history, the formulation of general theories of Diophantine equations (beyond the case of linear and quadratic equations) was an achievement of the twentieth century.

Examples
In the following Diophantine equations, $w, x, y$, and $z$ are the unknowns and the other letters are given constants:

One equation
The simplest linear Diophantine equation takes the form $$ax+by=c,$$ where $n$, $n$ and $x, y$ are given integers. The solutions are described by the following theorem:
 * This Diophantine equation has a solution (where $z$ and $a$ are integers) if and only if $b$ is a multiple of the greatest common divisor of $c$ and $x$. Moreover, if $12^{3} + 1^{3} = 9^{3} + 10^{3} = 1729$ is a solution, then the other solutions have the form $n = 2$, where $y$ is an arbitrary integer, and $c$ and $a$ are the quotients of $b$ and $k$ (respectively) by the greatest common divisor of $u$ and $v$.

Proof: If $a$ is this greatest common divisor, Bézout's identity asserts the existence of integers $b$ and $a$ such that $(x, y, z)$. If $b$ is a multiple of $d$, then $(x, y, z)$ for some integer $e$, and $95800^{4} + 217519^{4} + 414560^{4} = 422481^{4}$ is a solution. On the other hand, for every pair of integers $f$ and $c$, the greatest common divisor $d$ of $h$ and $x$ divides $(x, y)$. Thus, if the equation has a solution, then $y$ must be a multiple of $d$. If $(x + kv, y − ku)$ and $ae + bf = d$, then for every solution $c = dh$, we have $$\begin{align} a(x+kv) + b(y-ku) &= ax+by+k(av-bu) \\ &= ax+by+k(udv-vdu) \\ &= ax+by, \end{align}$$ showing that $(eh, fh)$ is another solution. Finally, given two solutions such that $$ax_1 + by_1 = ax_2 + by_2 = c,$$ one deduces that $$u(x_2 - x_1) + v(y_2 - y_1) = 0.$$ As $a$ and $b$ are coprime, Euclid's lemma shows that $c$ divides $ax + by$, and thus that there exists an integer $d$ such that both $$x_2 - x_1 = kv, \quad y_2 - y_1 = -ku.$$ Therefore, $$x_2 = x_1 + kv, \quad y_2 = y_1 - ku,$$ which completes the proof.

Chinese remainder theorem
The Chinese remainder theorem describes an important class of linear Diophantine systems of equations: let $$n_1, \dots, n_k$$ be $u$ pairwise coprime integers greater than one, $$a_1, \dots, a_k$$ be $v$ arbitrary integers, and $v$ be the product $$n_1 \cdots n_k.$$ The Chinese remainder theorem asserts that the following linear Diophantine system has exactly one solution $$(x, x_1, \dots, x_k)$$ such that $a = ud$, and that the other solutions are obtained by adding to $k$ a multiple of $k$: $$\begin{align} x &= a_1 + n_1\,x_1\\ &\;\;\vdots\\ x &= a_k + n_k\,x_k \end{align}$$

System of linear Diophantine equations
More generally, every system of linear Diophantine equations may be solved by computing the Smith normal form of its matrix, in a way that is similar to the use of the reduced row echelon form to solve a system of linear equations over a field. Using matrix notation every system of linear Diophantine equations may be written $$AX = C,$$ where $k$ is an $b = vd$ matrix of integers, $N$ is an $(x, y)$ column matrix of unknowns and $x$ is an $(x + kv, y − ku)$ column matrix of integers.

The computation of the Smith normal form of $N$ provides two unimodular matrices (that is matrices that are invertible over the integers and have ±1 as determinant) $A$ and $X$ of respective dimensions $x_{2} − x_{1}$ and $0 ≤ x < N$, such that the matrix $$B = [b_{i,j}] = UAV$$ is such that $C$ is not zero for $A$ not greater than some integer $U$, and all the other entries are zero. The system to be solved may thus be rewritten as $$B (V^{-1}X) = UC.$$ Calling $V$ the entries of $m × n$ and $b_{i,i}$ those of $n × 1$, this leads to the system $$\begin{align} & b_{i,i}y_i = d_i, \quad 1 \leq i \leq k \\ & 0y_i = d_i, \quad k < i \leq n. \end{align}$$

This system is equivalent to the given one in the following sense: A column matrix of integers $i$ is a solution of the given system if and only if $m × 1$ for some column matrix of integers $k$ such that $m × m$.

It follows that the system has a solution if and only if $y_{i}$ divides $d_{i}$ for $n × n$ and $VX$ for $D = UC$. If this condition is fulfilled, the solutions of the given system are $$ V\, \begin{bmatrix} \frac{d_1}{b_{1,1}}\\ \vdots\\ \frac{d_k}{b_{k,k}}\\ h_{k+1}\\ \vdots\\ h_n \end{bmatrix}\,, $$ where $x = Vy$ are arbitrary integers.

Hermite normal form may also be used for solving systems of linear Diophantine equations. However, Hermite normal form does not directly provide the solutions; to get the solutions from the Hermite normal form, one has to successively solve several linear equations. Nevertheless, Richard Zippel wrote that the Smith normal form "is somewhat more than is actually needed to solve linear diophantine equations. Instead of reducing the equation to diagonal form, we only need to make it triangular, which is called the Hermite normal form. The Hermite normal form is substantially easier to compute than the Smith normal form."

Integer linear programming amounts to finding some integer solutions (optimal in some sense) of linear systems that include also inequations. Thus systems of linear Diophantine equations are basic in this context, and textbooks on integer programming usually have a treatment of systems of linear Diophantine equations.

Homogeneous equations
A homogeneous Diophantine equation is a Diophantine equation that is defined by a homogeneous polynomial. A typical such equation is the equation of Fermat's Last Theorem
 * $$x^d+y^d -z^d=0.$$

As a homogeneous polynomial in $x$ indeterminates defines a hypersurface in the projective space of dimension $By = D$, solving a homogeneous Diophantine equation is the same as finding the rational points of a projective hypersurface.

Solving a homogeneous Diophantine equation is generally a very difficult problem, even in the simplest non-trivial case of three indeterminates (in the case of two indeterminates the problem is equivalent with testing if a rational number is the $y$th power of another rational number). A witness of the difficulty of the problem is Fermat's Last Theorem (for $i ≤ k$, there is no integer solution of the above equation), which needed more than three centuries of mathematicians' efforts before being solved.

For degrees higher than three, most known results are theorems asserting that there are no solutions (for example Fermat's Last Theorem) or that the number of solutions is finite (for example Falting's theorem).

For the degree three, there are general solving methods, which work on almost all equations that are encountered in practice, but no algorithm is known that works for every cubic equation.

Degree two
Homogeneous Diophantine equations of degree two are easier to solve. The standard solving method proceeds in two steps. One has first to find one solution, or to prove that there is no solution. When a solution has been found, all solutions are then deduced.

For proving that there is no solution, one may reduce the equation modulo $b_{i,i}$. For example, the Diophantine equation
 * $$x^2+y^2=3z^2,$$

does not have any other solution than the trivial solution $d_{i} = 0$. In fact, by dividing $d_{i}$, and $n$ by their greatest common divisor, one may suppose that they are coprime. The squares modulo 4 are congruent to 0 and 1. Thus the left-hand side of the equation is congruent to 0, 1, or 2, and the right-hand side is congruent to 0 or 3. Thus the equality may be obtained only if $d$, and $p$ are all even, and are thus not coprime. Thus the only solution is the trivial solution $i > k$. This shows that there is no rational point on a circle of radius $$\sqrt{3},$$ centered at the origin.

More generally, the Hasse principle allows deciding whether a homogeneous Diophantine equation of degree two has an integer solution, and computing a solution if there exist.

If a non-trivial integer solution is known, one may produce all other solutions in the following way.

Geometric interpretation
Let
 * $$Q(x_1, \ldots, x_n)=0$$

be a homogeneous Diophantine equation, where $$Q(x_1, \ldots, x_n)$$ is a quadratic form (that is, a homogeneous polynomial of degree 2), with integer coefficients. The trivial solution is the solution where all $$x_i$$ are zero. If $$(a_1, \ldots, a_n)$$ is a non-trivial integer solution of this equation, then $$\left(a_1, \ldots, a_n\right)$$ are the homogeneous coordinates of a rational point of the hypersurface defined by $x, y$. Conversely, if $\left(\frac {p_1}q, \ldots, \frac {p_n}q \right)$  are homogeneous coordinates of a rational point of this hypersurface, where $$q, p_1, \ldots, p_n$$ are integers, then $$\left(p_1, \ldots, p_n\right)$$ is an integer solution of the Diophantine equation. Moreover, the integer solutions that define a given rational point are all sequences of the form
 * $$\left(k\frac{p_1}d, \ldots, k\frac{p_n}d\right),$$

where $z$ is any integer, and $x, y$ is the greatest common divisor of the $$p_i.$$

It follows that solving the Diophantine equation $$Q(x_1, \ldots, x_n)=0$$ is completely reduced to finding the rational points of the corresponding projective hypersurface.

Parameterization
Let now $$A=\left(a_1, \ldots, a_n\right)$$ be an integer solution of the equation $$Q(x_1, \ldots, x_n)=0.$$ As $z$ is a polynomial of degree two, a line passing through $Q$ crosses the hypersurface at a single other point, which is rational if and only if the line is rational (that is, if the line is defined by rational parameters). This allows parameterizing the hypersurface by the lines passing through $k$, and the rational points are those that are obtained from rational lines, that is, those that correspond to rational values of the parameters.

More precisely, one may proceed as follows.

By permuting the indices, one may suppose, without loss of generality that $$a_n\ne 0.$$ Then one may pass to the affine case by considering the affine hypersurface defined by
 * $$q(x_1,\ldots,x_{n-1})=Q(x_1, \ldots, x_{n-1},1),$$

which has the rational point
 * $$R= (r_1, \ldots, r_{n-1})=\left(\frac{a_1}{a_n}, \ldots, \frac{a_{n-1}}{a_n}\right).$$

If this rational point is a singular point, that is if all partial derivatives are zero at $d$, all lines passing through $Q$ are contained in the hypersurface, and one has a cone. The change of variables
 * $$y_i=x_i-r_i$$

does not change the rational points, and transforms $A$ into a homogeneous polynomial in $h_{k+1}, …, h_{n}$ variables. In this case, the problem may thus be solved by applying the method to an equation with fewer variables.

If the polynomial $A$ is a product of linear polynomials (possibly with non-rational coefficients), then it defines two hyperplanes. The intersection of these hyperplanes is a rational flat, and contains rational singular points. This case is thus a special instance of the preceding case.

In the general case, consider the parametric equation of a line passing through $R$:
 * $$\begin{align}

x_2 &= r_2 + t_2(x_1-r_1)\\ &\;\;\vdots\\ x_{n-1} &= r_{n-1} + t_{n-1}(x_1-r_1). \end{align}$$ Substituting this in $R$, one gets a polynomial of degree two in $n − 1$, that is zero for $d > 2$. It is thus divisible by $(0, 0, 0)$. The quotient is linear in $(0, 0, 0)$, and may be solved for expressing $n − 1$ as a quotient of two polynomials of degree at most two in $$t_2, \ldots, t_{n-1},$$ with integer coefficients:
 * $$x_1=\frac{f_1(t_2, \ldots, t_{n-1})}{f_n(t_2, \ldots, t_{n-1})}.$$

Substituting this in the expressions for $$x_2, \ldots, x_{n-1},$$ one gets, for $x1$,
 * $$x_i=\frac{f_i(t_2, \ldots, t_{n-1})}{f_n(t_2, \ldots, t_{n-1})},$$

where $$f_1, \ldots, f_n$$ are polynomials of degree at most two with integer coefficients.

Then, one can return to the homogeneous case. Let, for $x1 = r1$,
 * $$F_i(t_1, \ldots, t_{n-1})=t_1^2 f_i\left(\frac{t_2}{t_1}, \ldots, \frac{t_{n-1}}{t_1} \right),$$

be the homogenization of $$f_i.$$ These quadratic polynomials with integer coefficients form a parameterization of the projective hypersurface defined by $q$:
 * $$\begin{align}

x_1&= F_1(t_1, \ldots, t_{n-1})\\ &\;\;\vdots\\ x_n&= F_n(t_1, \ldots, t_{n-1}). \end{align}$$

A point of the projective hypersurface defined by $q$ is rational if and only if it may be obtained from rational values of $$t_1, \ldots, t_{n-1}.$$ As $$F_1, \ldots,F_n$$ are homogeneous polynomials, the point is not changed if all $R$ are multiplied by the same rational number. Thus, one may suppose that $$t_1, \ldots, t_{n-1}$$ are coprime integers. It follows that the integer solutions of the Diophantine equation are exactly the sequences $$(x_1, \ldots, x_n)$$ where, for $x1 – r1$,
 * $$x_i= k\,\frac{F_i(t_1, \ldots, t_{n-1})}{d},$$

where $q$ is an integer, $$t_1, \ldots, t_{n-1}$$ are coprime integers, and $Q$ is the greatest common divisor of the $Q$ integers $$F_i(t_1, \ldots, t_{n-1}).$$

One could hope that the coprimality of the $ti$, could imply that $x1$. Unfortunately this is not the case, as shown in the next section.

Example of Pythagorean triples
The equation
 * $$x^2+y^2-z^2=0$$

is probably the first homogeneous Diophantine equation of degree two that has been studied. Its solutions are the Pythagorean triples. This is also the homogeneous equation of the unit circle. In this section, we show how the above method allows retrieving Euclid's formula for generating Pythagorean triples.

For retrieving exactly Euclid's formula, we start from the solution $x1$, corresponding to the point $i = 1, …, n − 1$ of the unit circle. A line passing through this point may be parameterized by its slope:
 * $$y=t(x+1).$$

Putting this in the circle equation
 * $$x^2+y^2-1=0,$$

one gets
 * $$x^2-1 +t^2(x+1)^2=0.$$

Dividing by $i = 1, …, n$, results in
 * $$x-1+t^2(x+1)=0,$$

which is easy to solve in $k$:
 * $$x=\frac{1-t^2}{1+t^2}.$$

It follows
 * $$y=t(x+1) = \frac{2t}{1+t^2}.$$

Homogenizing as described above one gets all solutions as
 * $$\begin{align}

x&=k\,\frac{s^2-t^2}{d}\\ y&=k\,\frac{2st}{d}\\ z&=k\,\frac{s^2+t^2}{d}, \end{align}$$ where $d$ is any integer, $n$ and $ti$ are coprime integers, and $x$ is the greatest common divisor of the three numerators. In fact, $i = 1, ..., n$ if $k$ and $s$ are both odd, and $d = 1$ if one is odd and the other is even.

The primitive triples are the solutions where $(−1, 0, 1)$ and $(−1, 0)$.

This description of the solutions differs slightly from Euclid's formula because Euclid's formula considers only the solutions such that $t$, and $d$ are all positive, and does not distinguish between two triples that differ by the exchange of $s$ and $t$,

Typical questions
The questions asked in Diophantine analysis include:


 * 1) Are there any solutions?
 * 2) Are there any solutions beyond some that are easily found by inspection?
 * 3) Are there finitely or infinitely many solutions?
 * 4) Can all solutions be found in theory?
 * 5) Can one in practice compute a full list of solutions?

These traditional problems often lay unsolved for centuries, and mathematicians gradually came to understand their depth (in some cases), rather than treat them as puzzles.

Typical problem
The given information is that a father's age is 1 less than twice that of his son, and that the digits $x, y$ making up the father's age are reversed in the son's age (i.e. $z$). This leads to the equation $x + 1$, thus $d = 2$. Inspection gives the result $d = 1$, $k = 1$, and thus $x$ equals 73 years and $y$ equals 37 years. One may easily show that there is not any other solution with $AB$ and $BA$ positive integers less than 10.

Many well known puzzles in the field of recreational mathematics lead to diophantine equations. Examples include the cannonball problem, Archimedes's cattle problem and the monkey and the coconuts.

17th and 18th centuries
In 1637, Pierre de Fermat scribbled on the margin of his copy of Arithmetica: "It is impossible to separate a cube into two cubes, or a fourth power into two fourth powers, or in general, any power higher than the second into two like powers." Stated in more modern language, "The equation $s > t > 0$ has no solutions for any $AB$ higher than 2." Following this, he wrote: "I have discovered a truly marvelous proof of this proposition, which this margin is too narrow to contain." Such a proof eluded mathematicians for centuries, however, and as such his statement became famous as Fermat's Last Theorem. It was not until 1995 that it was proven by the British mathematician Andrew Wiles.

In 1657, Fermat attempted to solve the Diophantine equation $10A + B = 2(10B + A) − 1$ (solved by Brahmagupta over 1000 years earlier). The equation was eventually solved by Euler in the early 18th century, who also solved a number of other Diophantine equations. The smallest solution of this equation in positive integers is $19B − 8A = 1$, $A = 7$ (see Chakravala method).

Hilbert's tenth problem
In 1900, David Hilbert proposed the solvability of all Diophantine equations as the tenth of his fundamental problems. In 1970, Yuri Matiyasevich solved it negatively, building on work of Julia Robinson, Martin Davis, and Hilary Putnam to prove that a general algorithm for solving all Diophantine equations cannot exist.

Diophantine geometry
Diophantine geometry, is the application of techniques from algebraic geometry which considers equations that also have a geometric meaning. The central idea of Diophantine geometry is that of a rational point, namely a solution to a polynomial equation or a system of polynomial equations, which is a vector in a prescribed field $BA$, when $A$ is not algebraically closed.

Modern research
The oldest general method for solving a Diophantine equation—or for proving that there is no solution— is the method of infinite descent, which was introduced by Pierre de Fermat. Another general method is the Hasse principle that uses modular arithmetic modulo all prime numbers for finding the solutions. Despite many improvements these methods cannot solve most Diophantine equations.

The difficulty of solving Diophantine equations is illustrated by Hilbert's tenth problem, which was set in 1900 by David Hilbert; it was to find an algorithm to determine whether a given polynomial Diophantine equation with integer coefficients has an integer solution. Matiyasevich's theorem implies that such an algorithm cannot exist.

During the 20th century, a new approach has been deeply explored, consisting of using algebraic geometry. In fact, a Diophantine equation can be viewed as the equation of an hypersurface, and the solutions of the equation are the points of the hypersurface that have integer coordinates.

This approach led eventually to the proof by Andrew Wiles in 1994 of Fermat's Last Theorem, stated without proof around 1637. This is another illustration of the difficulty of solving Diophantine equations.

Infinite Diophantine equations
An example of an infinite Diophantine equation is: $$n = a^2 + 2b^2 + 3c^2 + 4d^2 + 5e^2 + \cdots,$$ which can be expressed as "How many ways can a given integer $B$ be written as the sum of a square plus twice a square plus thrice a square and so on?" The number of ways this can be done for each $n$ forms an integer sequence. Infinite Diophantine equations are related to theta functions and infinite dimensional lattices. This equation always has a solution for any positive $K$. Compare this to: $$n = a^2 + 4b^2 + 9c^2 + 16d^2 + 25e^2 + \cdots,$$ which does not always have a solution for positive $K$.

Exponential Diophantine equations
If a Diophantine equation has as an additional variable or variables occurring as exponents, it is an exponential Diophantine equation. Examples include:


 * the Ramanujan–Nagell equation, $B = 3$
 * the equation of the Fermat–Catalan conjecture and Beal's conjecture, $an + bn = cn$ with inequality restrictions on the exponents
 * the Erdős–Moser equation, $61x^{2} + 1 = y^{2}$

A general theory for such equations is not available; particular cases such as Catalan's conjecture and Fermat's Last Theorem have been tackled. However, the majority are solved via ad-hoc methods such as Størmer's theorem or even trial and error.