# What are all the solutions to ax + by = 0 with nonzero integer coefficients?

Suppose we have an equation of the form $ax+by=0$ with $a,b,c \in \mathbb{Z}$. For simplicity, $a \neq 0, b \neq 0$. Then, a single solution to this equation is $(x_0, y_0)=(-a, b)$. My book states that all solutions are of the form $(x_0, y_0)=(-na,nb)$ with $n \in \mathbb{Z}$. But why? How we really know that this are all solutions. I tried this: Let $(x_1, y_1)$ be an arbitrary solution to this problem. Then $(x_0+x_1, y_0+y_1)$ is also a solution, so, "probably" $(x_0+nx_1, y_0 + ny_1)$ is a solution. Can someone help me out?

-

First, it must be $\,(-b,a)\,$ is a solution to $\,ax+by=0\,\,,\,\,ab\neq 0\,$ , and not $\,(-a,b)\,$ .

Second, let us solve parametrically the equation:

$$ax+by=0\Longleftrightarrow y=-\frac{a}{b}x\Longrightarrow \text{the general solution is}$$

$$\left(x\,,\,-\frac{a}{b}x\right)\Longleftrightarrow (-bx\,,\,ax)\,\,,\,\,x\in\Bbb Z$$

Please do note the first option above may not be defined in the integers, since it could be $\,a/b\notin\Bbb Z\,$ , but the second one's already fine (if you insist in integer solutions. If you're fine with rational ones then the first form is ok), and it is of the required form (after the correction mentioned at the beginning of my answer)

-
Ok, I think I get it, but why you know for sure that you have all solutions with that statement? – Kevin Sep 26 '12 at 11:36
Because the general solution is (i.e., all the solutions are) given by $\,y=-\frac{a}{b}x\,$ , when $\,x\,$ is taken from some nice set (a ring or a field, generally) , like $\,\Bbb Z\,,\,\Bbb Q\,$ , etc. – DonAntonio Sep 26 '12 at 11:43
But then not necesarilly $y \in \mathbb{Z}$? And when you multiply the solution by $b$ (or $-b$), then how you know you got all the solutions? – Kevin Sep 26 '12 at 12:01
Given in the form $\,y=-\frac{a}{b}x\,$ then no: not necessarily $\,y\in\Bbb Z\,$, but after we multiply through by $\,b\,$ (and we can do this because we have a homogeneous linear equation!), then, if we want to restrict ourselves to integers, all the solution will be integers. If we want rationals, o reals or complex, one way or another will give the same answers (as then we're messing with fields) – DonAntonio Sep 26 '12 at 12:06
So, now you are saying, $(x_0, y_0)$ is a solution $\Leftrightarrow (m x_0, m y_0)$ is a solution. This is not true. For example, if... Ah, I see :p. Thanks! – Kevin Sep 26 '12 at 13:36