Diophantine Equations – Integer Solution for ax + by = c

diophantine equationsdiscrete mathematicsdivisibilityelementary-number-theory

Let $a,b,c$ be positive integers. Verify that Diophantine equation $ax + by = c$ has integer solution $x_0, y_0$ if and only if $GCD(a,b)|c$.

Attempt

Diophantine $ax + by = c$ has integer solution $x_0, y_0$ implies $GCD(a,b)|c$. Factoring out $ GCD(a,b)$ from each side gives $$\frac{1}{GCD(a,b)}(ax + by) = \frac{1}{GCD(a,b)}c$$ which must still have an integer solution as $GCD(a,b)$ obviously divides both $a$ and $b$. If $GCD(a,b)$ does not divide $c$ there is no integer solution.

That $GCD(a,b)|c$ implies that $ax + by = c$ has integer solution $x_0, y_0$. Let $c = GCD(a,b)d$, where $d$ is integer.

$ax + by = GCD(a,b)d$; divide both sides by $GCD(a,b)$:
Obtain $mx + ny = d$ with $GCD(m,n) = 1$. If $d$ is an integer and $GCD(m,n) = 1$ then $x,y$ must be integers as $mx + ny$ cannot be further divided evenly.

or

$ax + by = c$ has no solution implies $GCD(a,b)$ does not divide c.
$c = GCD(a,b)(\frac{ax}{GCD(a,b)} + \frac{by}{GCD(a,b)}) + r$

with $GCD(a,b) > 0, 0<r<GCD(a,b)$, r integer

$\frac{c}{GCD(a,b)} = \frac{ax + by}{GCD(a,b)} + \frac{r}{GCD(a,b)}$

Best Answer

If $(a,b)\mid c$, $\exists t\in \mathbb{Z}$ such that $t(a,b)=c$. As we know that there exists $x,y \in \mathbb{Z}$ such that $ax+by=(a,b)$, then choose the integers $x_0=tx$ and $y_0=ty$.

To prove the converse, if $x_0$ and $y_0$ be integers, then $(a,b)\mid x_0a$ and $(a,b)\mid y_0y$ implies $(a,b)\mid (x_0a+y_0b)$.

Related Question