I am given two equations
\begin{alignat}{2} x&+\phantom{0}y&\phantom{0}+z&=\phantom{0}4 \\ 2x&+\phantom{0}y&\phantom{0}-2z\phantom{0}&=\phantom{0}4 \\ \end{alignat}
I am wondering how to solve this as when I do -2R1 - R2 -> R2 I end up with
\begin{alignat}{2} x&+\phantom{0}y&\phantom{0}+z&=\phantom{0}4 \\ 0x&+\phantom{0}0&\phantom{0}-4z\phantom{0}&=\phantom{0}0 \\ \end{alignat}
I know this is not correct but I am unable to solve this.
When you add to second row the first one times $-2$, what you get is$$\left\{\begin{array}{l}x-y+z=4\\3y-4z=-4\end{array}\right.$$So, $y=\frac43z-\frac43$. Now, replace $y$ by $\frac43z-\frac43$ in the first equation, and you will get $x$ as a function of $z$.