<s>[INST] Solve the following systems of equations ( Matrices) Solve the following systems of equations: 
\begin{Bmatrix}
       x_1 & -x_2 & -x_3 & +0x_4 & = 2 \\
        -x_1 & +2x_2 & +0x_3 & +3x_4 &= 1 \\
        x_1 & +0x_2 & +x_3 & +0x_4 & =5\\
        \end{Bmatrix}
I try to make a zero triangle but always reach a step where I'm in a cycle trying to do the same thing over and over. I once got $x_3=1/3$ 
Working: 
1-
\begin{Bmatrix}
       1 & -1 & -1 & +0 &  2 \\
        -1 & +2 & +0 & +3 & 1 \\
        1 & +0 & +1 & +0 & 5\\
        \end{Bmatrix}
2- Eq2 to Eq2 + Eq1
\begin{Bmatrix}
       1 & -1 & -1 & +0 &  2 \\
        0 & 1 & -1 & 3 & 3 \\
        1 & +0 & +1 & +0 & 5\\
        \end{Bmatrix}
3- Eq3 to Eq3 + Eq1
\begin{Bmatrix}
       1 & -1 & -1 & +0 &  2 \\
        0 & 1 & -1 & 3 & 3 \\
        0 & 1 & 2 & 0 & 3\\
        \end{Bmatrix}
4- Eq3 to Eq3 - Eq2
\begin{Bmatrix}
       1 & -1 & -1 & +0 &  2 \\
        0 & 1 & -1 & 3 & 3 \\
        0 & 0 & 3 & 0 & 1\\
        \end{Bmatrix}
Now I can say $3x_3=1$ 
Thus, $x_3=1/3$
After that i tried but couldn't complete...
Any suggestions would be appreciated
EDIT: The last step is incorrect.
It should be :
\begin{Bmatrix}
       1 & -1 & -1 & +0 &  2 \\
        0 & 1 & -1 & 3 & 3 \\
        0 & 0 & 3 & -3 & 0\\
        \end{Bmatrix}
So what I did next is:
From Third Row: $x_3+x_4=0$
so, $x_4=-x_3$
Then, From the Second row:
$x_2-x_3+3x_4=3$
$x_2-x_3+3(-x_3)=3$
$x_2-x_3=3$
$x_2=3+x_3$
And I stopped
 [/INST] when i row reduce your matrix $\pmatrix{1&-1&-1&0&2\\-1&2&0&3&1\\1&0&1&0&5}$ 
 i get $\pmatrix{1&0&0&1&5\\0&1&0&2&3\\0&0&1&-1&0}.$
let us call the variables $x_1, x_2, x_3$ and $x_4$ corresponding to the four columns. the fourth variable $x_4$ is called the free variable. to find a particular solution we set it to zero. you get a particular solution $x_1 = 5, x_2 = 3, x_3 = 0, x_4 = 0.$
to find the homogeneous solution we the free variable to one and delete the last column. so we $x_1 = -1, x_2 = -2, x_3 = 1, x_4 = 1.$
then general solution is $x_g = x_p + tx_h.$ in component form you have $$x_1 = 5-t, x_2 = 3-2t, x_3 = t, x_4 = t \text{ where $t$ is any real number.}$$
</s>