Four approaches to Diophantine equations, with complete examples

Original publication: Updated:

What is a Diophantine equation?

A Diophantine equation asks for integer solutions of a polynomial equation, or of a related equation with specified integer variables. Having fewer equations than unknowns does not by itself guarantee infinitely many solutions: integer restrictions and the shape of the equation matter.

Four useful starting points for entrance-exam problems are:

  1. A linear equation in two integers: find one solution, then describe all differences from it.
  2. A quadratic that can be rearranged into a product: enumerate factor pairs.
  3. A quadratic with a bounded real locus: use a discriminant or completed squares to restrict the variables.
  4. A symmetric equation in positive variables: order them and bound the smallest first.

These are useful patterns, not an exhaustive classification of Diophantine equations.

1. Linear equations: find one solution and subtract it

Problem. Find all integer pairs satisfying

5x+7y=1.5x+7y=1.

A particular solution is (x,y)=(3,−2)(x,y)=(3,-2). Subtract its equation from the general one:

5(x−3)+7(y+2)=0,5(x-3)+7(y+2)=0,

so 5(x−3)=−7(y+2)5(x-3)=-7(y+2). Since 55 and 77 are coprime, 77 divides x−3x-3. Write x−3=7kx-3=7k with integer kk. Substitution gives y=−5k−2y=-5k-2.

Therefore

(x,y)=(3+7k,−2−5k),k∈Z.\boxed{(x,y)=(3+7k,-2-5k),\qquad k\in\mathbb Z.}

Conversely, every pair of this form satisfies the original equation, so the parameterization is complete.

Large coefficients: use the Euclidean algorithm

To find a solution of 115x+366y=1115x+366y=1, perform the Euclidean algorithm:

366=3⋅115+21,115=5⋅21+10,21=2⋅10+1.366=3\cdot115+21,\quad115=5\cdot21+10,\quad21=2\cdot10+1.

Back-substitution gives

1=21−2(115−5⋅21)=11⋅21−2⋅115=11⋅366−35⋅115.\begin{aligned} 1&=21-2(115-5\cdot21)\\ &=11\cdot21-2\cdot115\\ &=11\cdot366-35\cdot115. \end{aligned}

Thus (−35,11)(-35,11) is a particular solution. This systematic procedure works even when guessing a solution is inconvenient.

More generally, Ax+By=CAx+By=C has integer solutions exactly when gcd⁡(A,B)\gcd(A,B) divides CC. If (x0,y0)(x_0,y_0) is one solution and d=gcd⁡(A,B)d=\gcd(A,B), then all solutions are

x=x0+Bdk,y=y0−Adk,k∈Z.x=x_0+\frac Bd k,\qquad y=y_0-\frac Ad k,\qquad k\in\mathbb Z.

For example, multiplying the solution (3,−2)(3,-2) by 10001000 gives (3000,−2000)(3000,-2000) as one solution of 5x+7y=10005x+7y=1000. Scaling a solution works here because the coefficients are coprime; when they are not, check the divisibility condition first.

2. Factorable quadratics: enumerate signed factor pairs

Problem. Find all integer solutions of

3x2+5xy+2y2+5x+3y−4=0.3x^2+5xy+2y^2+5x+3y-4=0.

Rearrange it as

(3x+2y−1)(x+y+2)=2.(3x+2y-1)(x+y+2)=2.

Both factors are integers. Therefore their ordered values must be

(1,2),(2,1),(−1,−2),(−2,−1).(1,2),\quad(2,1),\quad(-1,-2),\quad(-2,-1).

Let A=3x+2y−1A=3x+2y-1 and B=x+y+2B=x+y+2. Solving these linear equations gives

x=A−2B+5,y=3B−A−7.x=A-2B+5,\qquad y=3B-A-7.

The four factor pairs consequently give

(x,y)=(2,−2), (5,−6), (8,−12), (5,−8).\boxed{(x,y)=(2,-2),\ (5,-6),\ (8,-12),\ (5,-8).}

Each satisfies the original equation. In other problems a factor pair can give noninteger x,yx,y, so the final integrality check is necessary. Negative factor pairs must not be omitted when the variables are arbitrary integers.

3. Bound the variables before checking them

Problem. Find all integer solutions of

x2+2xy+2y2−2y−3=0.x^2+2xy+2y^2-2y-3=0.

A discriminant bound

Regard the equation as a quadratic in xx. Its discriminant is

D=(2y)2−4(2y2−2y−3)=4{4−(y−1)2}.D=(2y)^2-4(2y^2-2y-3)=4\{4-(y-1)^2\}.

A real xx requires D≥0D\ge0, hence −1≤y≤3-1\le y\le3. Since yy is an integer, only y=−1,0,1,2,3y=-1,0,1,2,3 remain.

For those values, x=−y±4−(y−1)2x=-y\pm\sqrt{4-(y-1)^2}. When y=0y=0 or 22, the remaining square root is 3\sqrt3, so xx is not an integer. The other values give

(x,y)=(1,−1), (−3,1), (1,1), (−3,3).\boxed{(x,y)=(1,-1),\ (-3,1),\ (1,1),\ (-3,3).}

A shorter completed-square argument

The same equation is equivalent to

(x+y)2+(y−1)2=4.(x+y)^2+(y-1)^2=4.

The only integer square pairs summing to 44 are (4,0)(4,0) and (0,4)(0,4). Enumerating the signs immediately gives the same four solutions.

A nonnegative discriminant does not always give a finite bound. For example, x2−2y2=1x^2-2y^2=1 has infinitely many integer solutions. The strategy works here because the completed-square expression is positive definite; it is not a universal rule for every nonfactorable quadratic.

4. Symmetric reciprocal equations: order the variables

Problem. How many ordered triples of positive integers satisfy

1x+1y+1z=1?\frac1x+\frac1y+\frac1z=1?

By symmetry, first impose x≤y≤zx\le y\le z. Then

1=1x+1y+1z≤3x,1=\frac1x+\frac1y+\frac1z\le\frac3x,

so x≤3x\le3. The value x=1x=1 is impossible because the other two reciprocals are positive.

Case x = 2

The remaining equation is

1y+1z=12⟺(y−2)(z−2)=4.\frac1y+\frac1z=\frac12\quad\Longleftrightarrow\quad(y-2)(z-2)=4.

Because 2≤y≤z2\le y\le z and both factors are positive, the possibilities are (y−2,z−2)=(1,4)(y-2,z-2)=(1,4) or (2,2)(2,2). Thus the increasing triples are (2,3,6)(2,3,6) and (2,4,4)(2,4,4).

Case x = 3

Now y,z≥3y,z\ge3, so 1/y+1/z≤2/31/y+1/z\le2/3. Equality is required, and it occurs only when y=z=3y=z=3. This gives (3,3,3)(3,3,3).

Restore the orderings

The three nondecreasing triples contribute different numbers of permutations:

  • (2,3,6)(2,3,6) has six permutations.
  • (2,4,4)(2,4,4) has three.
  • (3,3,3)(3,3,3) has one.

Therefore the number of ordered triples is

6+3+1=10.\boxed{6+3+1=10.}

Multiplying every case by six would overcount the repeated entries.

Choosing a first move

Look for coprimality in a linear equation, a product equal to a fixed integer, a bound obtained from real-solvability conditions, or symmetry among positive variables. Once the candidate list is finite, check it completely and prove that every proposed solution really works.

Related: three strategies for integer problems and the rational root theorem.

Related articles

About the author

Koki Saito

Physician and graduate of the University of Tokyo Faculty of Medicine. Drawing on his entrance-exam experience, he explains how to choose mathematical methods and construct complete solutions.

Full profile →

Have a question or spotted an error? Contact us.