$$ 3x+6y+5z=7 $$ The general solution to this linear Diophantine equation is as described here (Page 7-8) is:
$$ x = 5k+2l+14 $$ $$ y = -l $$ $$ z = -7-k $$ $$ k,l \in \mathbb{Z} $$
If I plug the original equation into Wolframalpha the solution is: $$ y = 5n+2x+2 $$ $$ z =-6n-3x-1 $$ $$ n \in \mathbb{Z} $$
I can rewrite this as:
$$ x = l $$ $$ y = 5k+2l+2 $$ $$ z = -6k-3l-1 $$ $$ k,l \in \mathbb{Z} $$
However now two equations depend on two variables ($k,l$) and one on one variable $l$. In the first solution one equation depends on two variables and two on one variable.
Questions:
How can I come from a representation like the one from wolfram alpha for the general solution to one where all equations depend on one distinct variable except one equation.
Is there always such a representation?
A general method, consists in put the matrix $\begin{bmatrix}3&6&5\end{bmatrix}$ in Smith normal form: $$\begin{bmatrix}3&6&5\end{bmatrix}=\begin{bmatrix}1&0&0\end{bmatrix}\begin{bmatrix}3&6&5\\1&2&2\\0&1&0\end{bmatrix}.$$
A solution of the equation $3x+6y+5z=7$ is clearly $(x,y,z)=(0,7,-7)$. Clearly, a triple $(x,y,z)$ satisfies $3x+6y+5z=0$ if and only if: $$\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}3&6&5\\1&2&2\\0&1&0\end{bmatrix}^{-1}\begin{bmatrix}0\\k\\l\end{bmatrix}=\begin{bmatrix}2&-5&-2\\0&0&1\\-1&3&0\end{bmatrix}\begin{bmatrix}0\\k\\l\end{bmatrix}=\begin{bmatrix}-5k-2l\\l\\3k\end{bmatrix},$$
Thus, the set of all solutions of $3x+6y+5z=7$ are the triples of the form: $$(x,y,z)=(-5k-2l,7+l,-7+3k),$$ that's: $$\left\{\begin{matrix}x=-5k-2l\\y=7+l\\z=-7+3k\end{matrix}\right.$$