# 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

-
But the last row is $(0\ 0\ 0\ 0\ 0)$, and not $(0\ 0\ 0\ 0\ 4)$. So the equation is $0x_1 + 0x_2 + 0x_3 + 0x_4 = 0$, which is perfectly alright. – M. Vinay Jun 2 '14 at 11:26
You've done $17+(-16)=-1$ in the third matrix, but this seems to be a typo since otherwise you can't get the last row just with $0$'s. In any case your question is not related to these typos. To answer it: there is nothing wrong (except for the typos). – Git Gud Jun 2 '14 at 11:28
@GitGud but how can i get the solutions for the variables? Thanks – John Smith Jun 2 '14 at 11:31
From the second and third rows (in the last matrix, after it is fixed) you can get $x_3$ as a function of $x_4$ or $x_4$ as a function of $x_3$. Then using the first line you can get $x_1$ as a function of $x_2, x_3$ and $x_4$ or $x_2$ as a function of $x_1, x_3$ and $x_4$, as you prefer. Two variables will act as parameters. – Git Gud Jun 2 '14 at 11:35

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$.

-
Should mean i begin with removing the $-20$ in the matrix? – John Smith Jun 2 '14 at 11:40
I've edited the answer, please check out the last part. – M. Vinay Jun 2 '14 at 11:50

$$\begin{pmatrix} 6 & 4 & 8 & 17 & -20 \\ 0 & 0 & -2 & \color{red}{-1} & -4 \\ 0 & 0 & -6 & 3 & -12\\ 0 & 0 & 2 & -1 &4\\ \end{pmatrix}$$

should be $$\begin{pmatrix} 6 & 4 & 8 & 17 & -20 \\ 0 & 0 & -2 & \color{green}{+1} & -4 \\ 0 & 0 & -6 & 3 & -12\\ 0 & 0 & 2 & -1 &4\\ \end{pmatrix}$$

-
And how should i continue to get the solution? – John Smith Jun 2 '14 at 11:33
Solve it, edit the question with the new solution and I will have a look. I am not going to solve it for you. – 5xum Jun 2 '14 at 11:34