Linear Diophantine Equations in Three Variables

One way to solve this is to note that $(3,6)=3$ and solve, for $w=x+2y$, $$ 3w+5z=7\tag{1} $$ Using the Extended Euclidean Algorithm as implemented in this answer $$ \begin{array}{r} &&1&1&2\\\hline 1&0&1&-1&3\\ 0&1&-1&2&-5\\ 5&3&2&1&0\\ \end{array}\tag{2} $$ Thus, the second to last column gives a particular solution: $$ 3(2)+5(-1)=1\stackrel{\times7}{\implies}3(14)+5(-7)=7\tag{3} $$ and the last column gives the homogenous solution, which we add to get the general solution: $$ 3(\overbrace{14-5k}^w)+5(\overbrace{-7+3k}^z)=7\tag{4} $$ Now, we solve for $w=1x+2y=14-5k$ in the same manner we got from $(1)$ to $(4)$: $$ 1(\overbrace{14-5k+2j}^x)+2(\overbrace{0-j}^y)=\overbrace{14-5k}^w\tag{5} $$ Multiply $(5)$ by $3$ and plug into $(4)$: $$ 3(\overbrace{14-5k+2j}^x)+6(\overbrace{-j}^y)+5(\overbrace{-7+3k}^z)=7\tag{6} $$


Other answers will come from a reversible change of variables. The answer in $(6)$ is $$ \begin{bmatrix} x\\ y\\ z \end{bmatrix} = \color{#C000FF} {\begin{bmatrix} 14&2&-5\\ 0&-1&0\\ -7&0&3 \end{bmatrix}} \begin{bmatrix} 1\\ j'\\ k' \end{bmatrix}\tag{7} $$ The first "solution" above does not work (mapping $l\leftrightarrow j$): $$ \begin{align} 3x+6y+5z &=3(5k+2j+14)+6(-j)+5(-7-k)\\ &=7+10k\tag{8} \end{align} $$

If we change $z$ to $-7-3k$, the first solution above is $$ \begin{align} \begin{bmatrix} x\\ y\\ z \end{bmatrix} &= \begin{bmatrix} 14&2&5\\ 0&-1&0\\ -7&0&-3 \end{bmatrix} \begin{bmatrix} 1\\ j\\ k \end{bmatrix}\\ &= \color{#C000FF} {\begin{bmatrix} 14&2&-5\\ 0&-1&0\\ -7&0&3 \end{bmatrix}} \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&-1 \end{bmatrix} \begin{bmatrix} 1\\ j\\ k \end{bmatrix}\tag{9} \end{align} $$ which is the solution in $(6)$ under the reversible change $(j,k)=(j',-k')$.

The solution from Wolfram Alpha is $$ \begin{align} \begin{bmatrix} x\\ y\\ z \end{bmatrix} &= \begin{bmatrix} 0&1&0\\ 2&2&5\\ -1&-3&-6 \end{bmatrix} \begin{bmatrix} 1\\ j\\ k \end{bmatrix}\\ &= \color{#C000FF} {\begin{bmatrix} 14&2&-5\\ 0&-1&0\\ -7&0&3 \end{bmatrix}} \begin{bmatrix} 1&0&0\\ -2&-2&-5\\ 2&-1&-2 \end{bmatrix} \begin{bmatrix} 1\\ j\\ k \end{bmatrix}\tag{10} \end{align} $$ which is the solution in $(6)$ under the change $(j',k')=(-2-2j-5k,2-j-2k)$ and since $$ \begin{bmatrix} 1&0&0\\ -2&-2&-5\\ 2&-1&-2 \end{bmatrix}^{-1} = \begin{bmatrix} 1&0&0\\ 14&2&-5\\ -6&-1&2 \end{bmatrix}\tag{11} $$ the change of variables is reversible: $(j,k)=(14+2j'-5k',-6-j'+2k')$.


1142388    $3x+6y+5z=7$
$3x=7-6y-5z$
$x=\frac{7-6y-5z}3=2-2y-2z+\frac{1+z}3$
New variable $a=\frac{1+z}3$
$y$ had no fractional residue,
so set $y=b$, another new variable.
$z=3a-1$
$x=\frac{7-6b-5(3a-1)}3=4-2b-5a$
Is ${3(4-2b-5a)+6b+5(3a-1)}=7$
true?