# Solving linear Diophantine equation in 4 variables.

How can I solve (nontrivially) this equation in nonnegative integers: $$x - 2y + 3z - 4t = 0.$$

By inspection I found the set of solutions is: {(2,1,0,0),(4,0,0,1), (0,3,2,0), (1,0,1,1), (0,0,4,3), (0,1,2,1), (1,2,1,0),(6,1,0,1)}

1- Is my solution correct?

2- Also, I got a hint that this can be solved as a linear Diophantine equation but I only know how to do this for 2 variable and sometimes for 3 (where I express the third variable in terms of the other two)but not for 4 variables.

Any help will be appreciated.

• How did you miss the easiest one: $x,y,z,t=0$? Feb 22 at 1:17
• I am searching for nontrivial ones @vitamind
– user889696
Feb 22 at 1:18
• @hardmath I edited my post.
– user889696
Feb 22 at 1:27
• Are you saying applying Diophantine 2 times?@hardmath
– user889696
Feb 22 at 1:28
• I don't think I said "applying Diophantine 2 times" but you might be looking at the two "free parameters" $y,t$ identified in the Accepted Answer as giving us solution families that can be added to generate any possible solution. Feb 22 at 1:31

As for explicit solutions;for any $$y,t\geq0$$ and any $$z\geq0$$ such that $$3z\leq2y+4t$$ you have $$x:=2y-3z+4t\geq0.$$