Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Diophantine equations are equations where the solutions must be integers, such as whole numbers or negative whole numbers. They are named after Diophantus of Alexandria and appear throughout number theory, cryptography, puzzles, and computer science. The restriction to integers makes familiar algebra much more selective because many real-number solutions no longer count.

A central example is the linear Diophantine equation ax + by = c, where a, b, and c are integers and we search for integer pairs (x, y).

The key idea for ax + by = c is divisibility by the greatest common divisor of a and b. Integer solutions exist exactly when gcd(a, b) divides c. Once one solution is found, all solutions can be generated by stepping through a regular pattern on the integer lattice.

This makes Diophantine equations a powerful bridge between algebra, divisibility, and geometric patterns on grids.

Understanding Math: Diophantine Equations

The greatest common divisor rule comes from a deeper fact about combinations of whole-number multiples. Every value made by multiplying one coefficient and the first variable, then adding the other coefficient times the second variable, must be a multiple of their greatest common divisor. For example, fourteen times one variable plus twenty-one times the other variable can only produce multiples of seven.

Since thirty-five is a multiple of seven, a solution is possible. After dividing every term by seven, the simpler equation is two times the first variable plus three times the second variable equals five.

One solution is first variable equals one and second variable equals one. This check is worth doing because it catches many arithmetic errors early.

Finding one solution is only the start. The extended Euclidean algorithm works backward through repeated division and expresses the greatest common divisor as a combination of the two coefficients. That combination can then be scaled to reach the required total.

In the example, changing the first variable by three keeps the total balanced if the second variable changes by negative two. Starting from one and one gives values such as four and negative one, or negative two and three. Each pair gives the same total.

The regular movement happens because the coefficients have been reduced by their common divisor. It is a reliable pattern, not a lucky list of answers.

Many real problems add limits that pure algebra does not include. A shop may sell items only in nonnegative quantities. A packing problem may require a positive number of boxes.

In those settings, some integer solutions must be rejected. For the example, the first variable must stay at zero or above and the second variable must do the same. The allowed steps are then limited to a finite range.

This turns an equation into a practical counting task. Students meet this idea in coin problems, recipe batch sizes, seating arrangements, timetables, and combinations of package sizes. The equation finds possible totals, while the limits decide which possibilities make sense.

Not every Diophantine equation is linear. Equations involving squares, products of variables, or higher powers can behave very differently. A product condition may be solved by listing factor pairs.

A square condition may be tested using remainders. For instance, a square leaves only certain remainders after division by a small number, so an impossible remainder can rule out all solutions before any long calculation. This is one reason number theory often uses modular arithmetic.

When learning the topic, separate three jobs carefully. First decide whether solutions can exist. Next find a starting solution if one exists.

Finally apply any conditions about positivity, size, or range. Keep signs under control, reduce by the greatest common divisor when appropriate, and substitute every final answer back into the original equation.

Key Facts

  • A Diophantine equation is an equation whose solutions are restricted to integers.
  • A linear Diophantine equation in two variables has the form ax + by = c, where a, b, and c are integers.
  • The equation ax + by = c has integer solutions if and only if gcd(a, b) divides c.
  • If d = gcd(a, b) and d divides c, divide by d to simplify: (a/d)x + (b/d)y = c/d.
  • If (x0, y0) is one solution to ax + by = c, then all solutions are x = x0 + (b/d)t and y = y0 - (a/d)t, where t is any integer and d = gcd(a, b).
  • The Euclidean algorithm can find gcd(a, b), and the extended Euclidean algorithm can find one integer solution.

Vocabulary

Diophantine equation
An equation for which only integer solutions are allowed.
Integer solution
A solution in which every variable is an integer, such as -3, 0, or 8.
Greatest common divisor
The greatest common divisor, or gcd, of two integers is the largest positive integer that divides both of them.
Linear Diophantine equation
A Diophantine equation where the variables appear only to the first power, such as ax + by = c.
Integer lattice
The integer lattice is the grid of points in the coordinate plane whose coordinates are both integers.

Common Mistakes to Avoid

  • Forgetting to check gcd(a, b) divides c: this is wrong because ax + by = c has no integer solutions unless the greatest common divisor of a and b divides c.
  • Treating any real-number solution as valid: this is wrong because Diophantine equations require integer values for the variables.
  • Finding one solution and stopping: this is incomplete because a linear Diophantine equation usually has infinitely many integer solutions that follow a formula.
  • Using the wrong signs in the general solution: this is wrong because if x increases by b/d, then y must decrease by a/d to keep ax + by equal to c.

Practice Questions

  1. 1 Determine whether 18x + 30y = 42 has integer solutions. If it does, find one solution.
  2. 2 Find the general integer solution to 7x + 5y = 1.
  3. 3 Explain why the points that solve ax + by = c form a straight line, but only some points on that line count as Diophantine solutions.