Number System

Linear Diophantine Equation

Discrete points lie along an oblique line.

Linear Diophantine Equation definition

A linear Diophantine equation in two variables is an equation ax + by = c whose solutions x and y must be integers.

In Spanish
ecuación diofántica lineal
Topic
Integer equations and number theory

Linear Diophantine Equation in a picture

Linear Diophantine Equation diagramFor 6x + 9y = 15, the gcd is 3 and divides 15.Find gcd(6, 9) = 3Check whether 3 divides 15Use a solution (1, 1)It gives 6 + 9 = 15Move by steps (3, −2)The left-hand sum stays fixed
For 6x + 9y = 15, the gcd is 3 and divides 15.

How it works

Assume integer coefficients with a and b not both zero. Let d = gcd(a, b), taken positive. An integer solution exists exactly when d divides c. If (x₀, y₀) is one solution, all are x = x₀ + (b/d)t and y = y₀ − (a/d)t for integer t.

Worked examples

Does 4x + 6y = 9 have integer solutions?

No. The gcd 2 does not divide 9.

Find one solution to 4x + 6y = 10.

The pair (1, 1) works.

Find another solution from (1, 1).

Add (3, −2) to obtain (4, −1).

Common mistake

The gcd test establishes integer solutions. For nonnegative solutions, also check the signs of the resulting values.

Quick check

When does ax + by = c have integer solutions?

What controls the free parameter?

Show answer

It must be an integer.

Which identity can produce a starting solution?

Show answer

Bézout’s identity.

Sources

Flashcard

Linear Diophantine Equation

Reveal the definition

A linear Diophantine equation in two variables is an equation ax + by = c whose solutions x and y must be integers.

Effortless Math. “Linear Diophantine Equation.” Math Dictionary.