# solving a linear equation in the integers

I am trying to find the general solution in two variables of:

$5x+7y+9z=11$ in the integers, so I define a new variable $t=x+y+z$ so this becomes:

$5t+2y+4z=11$ and again define a new variable $u=y+2t+2z$ so that this becomes:

$t+2u=11$

I am now unsure as to how to proceed?

-
I am not sure where you are trying to go with this. I mean, I could also define $t = 5x + 7y + 9z$ to get the equation $t = 11$ but that doesn't really help. – TMM Apr 23 '13 at 13:44

You're almost done. Eliminating $\,t\,$ by back-substitution yields the general solution

$$\begin{eqnarray} x &\,=\,& \ \ \ 33\,+\,z\,-\,7u\\ y &\,=\,& -22-2z+5u\end{eqnarray}$$

-

Since $\gcd(5,7)=\gcd(5,9)=\gcd(7,9)=1$, there will be infinitely many solutions using any two of the variables alone. Are you trying to find all of them, or just one?

Assuming you want all of them:

Let $z$ be arbitrary. We want to find $x,y$ satisfying $5x+7y=(11-9z)$. We may take $x=3(11-9z)+7k, y=-2(11-9z)-5k$, for any $k\in \mathbb{Z}$.

-
I am trying to find the general solution in two variables, I've edited it now – user73957 Apr 23 '13 at 13:35
where did these solutions come from? where do the -2 and 3 come from? – user73957 Apr 23 '13 at 13:47
$3\cdot 5 -2 \cdot 7 =1$, a minimal solution to Bezout's identity. – vadim123 Apr 23 '13 at 13:49
ok, thanks- does this work for all 3 variable linear equations in the integers? – user73957 Apr 23 '13 at 13:59
Not this nicely, if the coefficients aren't pairwise relatively prime, there are some tweaks. – vadim123 Apr 23 '13 at 14:04