Proof for a general integer solution of the equation += Given $a,b\in\mathbb{Z}-\{0\}$ and $N\in\mathbb{Z}$, it is easy to show that if $x_0,y_0\in\mathbb{Z}$ are a particular solution to $ax+by=N$, then $x=x_0+\frac{b}{d}t$ and $y=y_0-\frac{a}{d}t$, where $d=gcd(a,b)$ and $t\in\mathbb{Z}$, are also solution to $ax+by=N$.
But may I ask how to proof that they are actually the general solution to $ax+by=N$ if we restrict the solutions inside $\mathbb{Z}$? (i.e. all integer solutions have been counted)
Thanks!
 A: Let A be the set of all ordered pairs integer solutions. Let B be the set of all ordered pairs of integer solutions only of the form you gave. We know $B \subseteq A$
First find all the rational solutions for the equation, then restrict them.
Let
$x=x_0+bu$
for $u \in\mathbb{Q}$
This is solvable for u for any rational x.
And then using
$ax+by=N$
$a(x_0+bu)+by=N$
$y=\frac{N-a(x_0+bu)}{b}$
$y=\frac{by_0-abu}{b} = y_0-au$, which is also rational.
So every element of A can be written as $(x_0+bu,y_0-au)$ for some rational u.
So let $(x_0+bu,y_0-au) \in A$
We require
$bu \in \mathbb{Z}$
$au \in \mathbb{Z}$
write $u=\frac{m}{n}$. Assume this is in lowest terms
So
$\frac{bm}{n} \in \mathbb{Z}$
$\frac{am}{n} \in \mathbb{Z}$
So $n|b$ and $n|a$
That means $n|d$ where $d=gcd(a,b)$
We can write $rn=d$ for some integer r
So $n = \frac{d}{r}$
$\frac{bm}{n} = \frac{b}{d}(rm)$
$\frac{am}{n} = \frac{a}{d}(rm)$
So letting $t=rm$, we know that $(x_0+\frac{b}{d}t,y_0-\frac{a}{d}t) \in B$
So $A \subseteq B$ giving us $A=B$.
