# What is the genral solution to $x+3y=8+6k$ in this diophantine equation?

I am doing maths for fun and stumbled upon this amazing worksheet. The second last question is a Diophantine equation with three variables and the solution ends with the general solution to the equation. I understand everything except how they go from

$$w-6z=2\\w=8+6k\\z=1+k\\x+3y=8+6k$$

to the "general solution of x and y" from the above equation to

$$x=8+3t\\y=2k-t$$

I understand that they get $$w=8+6k$$ and $$z=1+k$$ from the solution $$(8, 1)$$ but how they get to the general solution of x and y is unclear to me.

You have $$2x+6y-12z=4$$or$$2(x+3y)-12z=4.$$

So setting $$w=x+3y$$ we have $$2w-12z=4$$ $$w-6z=2$$ which is the diophantine equation in two variables. The above has general solution $$w=8+6k$$$$z=1+k$$ for $$k\in\mathbb Z$$. Since substituting gives $$w-6z=(8+6k)-6(1+k)=8-6+6k-6k=2$$ as required. But we know that $$w=x+3y$$ so it follows that $$x+3y=8+6k.$$

So choosing $$x=8+3t$$ and $$y=2k-t$$ we see that it indeed satisfies the above equation.

This is called parametrisation. So for instance we can write the line $$y=x+2$$ to be $$(x,y)=(t,t+2)$$ for all $$t\in\mathbb Z$$ by setting $$x=t$$. From above we had $$x+3y=8+6k$$, now set $$x=8+3t$$ then we obtain $$x+3y=8+3t+3y=8+6k$$ $$3t+3y=6k$$ so $$y=2k-t$$.

$$x+3y=8+6k$$ let $$y=t$$, then $$x=8+6k-3t$$, where $$t \in \Re$$ So the solutions are is $$x=8+6k-3t, y=t$$.

If you put $$y = 2k - t$$ in $$x+3y=8+6k$$, you get $$x=8+3t$$.

So, $$(x,y) = (8+3t, 2k-t)$$.