Get variables with Matrix I try to get the variables for this equation:
$$\begin{cases}
6x_1 + 4x_2 + 8x_3 + 17x_4 &= -20\\
3x_1 + 2x_2 + 5x_3 +  8x_4 &= -8\\
3x_1 + 2x_2 + 7x_3 + 7x_4 &= -4\\
0x_1 + 0x_2 + 2x_3 -1x_4 &= 4
\end{cases}$$
So i started with:
$$        \begin{pmatrix}
        6 & 4 & 8 & 17 & -20 \\
        3 & 2 & 5 & 8 & -8 \\
        3 & 2 & 7 & 7 & -4\\
        0 & 0 & 2 & -1 &4\\
        \end{pmatrix}$$ 
Then I continued: $$
        \begin{pmatrix}
        6 & 4 & 8 & 17 & -20 \\
        -6 & -4 & -10 & -16 & 16 \\
        -6 & -4 & -14 & -14 & 8\\
        0 & 0 & 2 & -1 &4\\
        \end{pmatrix}
$$
And began to count:
$$
        \begin{pmatrix}
        6 & 4 & 8 & 17 & -20 \\
        0 & 0 & -2 & -1 & -4 \\
        0 & 0
 & -6 & 3 & -12\\
        0 & 0 & 2 & -1 &4\\
        \end{pmatrix}
$$
And finally I transformed it to:$$
        \begin{pmatrix}
        6 & 4 & 8 & 17 & -20 \\
        0 & 0 & -2 & -1 & -4 \\
        0 & 0
 & -6 & 3 & -12\\
        0 & 0 & 0 & 0 &0\\
        \end{pmatrix}
$$
What did i wrong? I think the last row cannot be correct because:
$$(0, 0 ,0 , 0) \neq 0x_1 + 0x_2 + 2x_3 -1x_4 = 4$$
How should i solve it? Thanks

As Git Gud points out, it should be 1, not -1. Now if you correct that and proceed further, the third row also will become zero, and you'll get
$\left(\begin{matrix}
6 & 4 & 8 & 17 & -20\\
0 & 0 & -2 & 1 & -4\\
0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0
\end{matrix}\right)$
so that
$6x_1 + 4x_2 + 8x_3 + 17x_4 = -20\\
-2x_3 + x_4 = -4$
which can be solved by back-substitution.
From the second equation, you'll get $x_4 = 2x_3 - 4$. Substitute this in the first to get $x_1$ in terms of $x_2$ and $x_3$.
