Finding all Solutions to Diophantine Equations

Reading

Practice Problems

5.4
1-4, 10-12, 20, 21, 22
Challenge 5.4
(Optional) 18, 19

Notes

Now that we know how to find one solution, the question naturally arises if we can find more, preferably if we can find them all.

Let us think about this for a minute. Suppose we did have another solution, so:

\[ax_1 + by_1 = c = ax_2 + by_2\]

Then we should be able to say:

\[a(x_1-x_2) = b(y_2-y_1)\]

So there is some relation between these solutions and a common multiple of \(a\) and \(b\). Let's make it more precise:

If \(ax_1 + by_1 = c\) is a solution.

Then every other solution can be obtained as

\[x_2 = x_1 - k_1, \quad y_2 = y_1 + k_2\]

where \((k_1, k_2)\) are such that \(ak_1 = bk_2\).

This is easy to see. So the solutions to the diophantine equations are in 1-1 correspondence with these pairs of numbers.

Before we see the main theorem, let us have some definitions and a key result:

Let \(d=\gcd(a,b)\) and \(m=lcm(a,b)\). Further let \(a'd = a\) and \(b'd = b\). Then:

To see this:

Here is the main theorem that tells us how to find other solutions:

Suppose \(a x_1 + b y_1 = c\) and \(a'\), \(b'\) are as above.

Then \(a (x_1 - kb') + b (y_1 + ka') = c\) for all integers \(k\).

Moreover, all solutions to \(ax+by = c\) have this form.

To see this:

Let \(d=\gcd(a,b)\) and \(a'\), \(b'\) are as before.

Then for any pair \((k_1, k_2)\) with \(ak_1 = bk_2\) there is an integer \(k\) such that

\[k_1 = k b',\quad k_2 = k a'\]

Let us prove this:

Random property of the gcd that is worth mentioning.

If \(\gcd(a,b) = 1\) and \(b | ac\), then it must be the case that \(b|c\).

To prove this: