# Thread: System of linear equations using matrices

1. ## System of linear equations using matrices

Hi again!
So even though I more or less know how to solve a system of linear equations, I still can't help keep getting lost whenever things get more complicated.

For example, I've got this linear system that I can't seem to solve even though the end result is supposed to be rather simple. So, I've got this linear system:
|2x1 + x2 - 5x3 + x4 = 8
|x1 - 3x2 + 0x3 -6x4 = 9
|0x1 + 2x2 - x3 + 2x4 = -5
|x1 + 4x2 -7x3 + 6x4 = 0

And so, using the coefficients, you get this coefficient matrix:
2 1 -5 1 | 8
1 -3 0 -6 | 9
0 2 -1 2 | -5
1 4 -7 6 | 0

Anyone care to help from here on? I've certainly tried, but my level of maths isn't enough to get an answer out of that.

2. ## Re: System of linear equations using matrices

Originally Posted by JacobE
Hi again!
So even though I more or less know how to solve a system of linear equations, I still can't help keep getting lost whenever things get more complicated.

For example, I've got this linear system that I can't seem to solve even though the end result is supposed to be rather simple. So, I've got this linear system:
|2x1 + x2 - 5x3 + x4 = 8
|x1 - 3x2 + 0x3 -6x4 = 9
|0x1 + 2x2 - x3 + 2x4 = -5
|x1 + 4x2 -7x3 + 6x4 = 0
Look at the inverse.

3. ## Re: System of linear equations using matrices

Use Gauss–Jordan elimination.

1) reverse rows 1 and 2;
2) subtract row 1 from row 4, multiply row 1 by 2 and subtract it from row 2;
3) subtract row 2 from row 4;
4) add row 3 to row 1, multiply row 3 by 3 and subtract it from row 2;
5) multiply row 2 by 2 and subtract it from row 3;
6) add row 4 to row 3;
7) multiply row 3 by 2 and add it to row 4;
8) devide row 4 by -27;
9) multiply row 4: by 13 and add it row 3, by -7 and add it row 2, by 4 and add it row 1;
10) multiply row 3 by 2 and add it to row 2, add row 3 to row 1;
11) add row 2 to row 1.

$\displaystyle \left[\!\begin{array}{*{20}{r}}2&1&{-5}&1\!\!&\vline\!\!&8\\1&{-3}&0&{-6}\!\!&\vline\!\!&9\\0&2&{-1}&2\!\!&\vline\!\!&{-5}\\1&4&{-7}&6\!\!&\vline\!\!&0\end{array} \!\right]\mathop{\sim}^{{}^{\bold{1)}}} \left[\!\begin{array}{*{20}{r}}1&{-3}&0&{-6}\!\!&\vline\!\!&9\\2&1&{-5}&1\!\!&\vline\!\!&8\\0&2&{-1}&2\!\!&\vline\!\!&{-5}\\1&4&{-7}&6\!\!&\vline\!\!&0\end{array}\!\right]\mathop{\sim}^{{}^{\bold{2)}}} \left[\!\begin{array}{*{20}{r}}1&{-3}&0&{-6}\!\!&\vline\!\!&9\\0&7&{-5}&{13}\!\!&\vline\!\!&{-10}\\0&2&{-1}&2\!\!&\vline\!\!&{-5}\\0&7&{-7}&{12}\!\!&\vline\!\!&{-9}\end{array}\!\right]$

$\displaystyle \mathop{\sim}^{{}^{\bold{3)}}}\left[\!\begin{array}{*{20}{r}}1&{-3}&0&{-6}\!\!&\vline\!\!&9\\0&7&{-5}&{13}\!\!&\vline\!\!&{-10}\\0&2&{-1}&2\!\!&\vline\!\!&{-5}\\0&0&{-2}&{-1}\!\!&\vline\!\!&1\end{array}\!\right]\mathop{\sim}^{{}^{\bold{4)}}} \left[\!\begin{array}{*{20}{r}}1&{-1}&{-1}&{-4}\!\!&\vline\!\!&4\\0&1&{-2}&7\!\!&\vline\!\!&5\\0&2&{-1}&2\!\!&\vline\!\!&{-5}\\0&0&{-2}&{-1}\!\!&\vline\!\!&1\end{array}\!\right]\mathop{\sim}^{{}^{\bold{5)}}} \left[\!\begin{array}{*{20}{r}}1&{-1}&{-1}&{-4}\!\!&\vline\!\!&4\\0&1&{-2}&7\!\!&\vline\!\!&5\\0&0&3&{-12}\!\!&\vline\!\!&{-15}\\0&0&{-2}&{-1}\!\!&\vline\!\!&1\end{array}\!\right]$

$\displaystyle \mathop{\sim}^{{}^{\bold{6)}}}\left[\!\begin{array}{*{20}{r}}1&{-1}&{-1}&{-4}\!\!&\vline\!\!&4\\0&1&{-2}&7\!\!&\vline\!\!&5\\0&0&1&{-13}\!\!&\vline\!\!&{-14}\\0&0&{-2}&{-1}\!\!&\vline\!\!&1\end{array}\!\right]\mathop{\sim}^{{}^{\bold{7)}}} \left[\!\begin{array}{*{20}{r}}1&{-1}&{-1}&{-4}\!\!&\vline\!\!&4\\0&1&{-2}&7\!\!&\vline\!\!&5\\0&0&1&{-13}\!\!&\vline\!\!&{-14}\\0&0&0&{-27}\!\!&\vline\!\!&{-27}\end{array}\!\right]\mathop{\sim}^{{}^{\bold{8)}}} \left[\!\begin{array}{*{20}{r}}1&{-1}&{-1}&{-4}\!\!&\vline\!\!&4\\0&1&{-2}&7\!\!&\vline\!\!&5\\0&0&1&{-13}\!\!&\vline\!\!&{-14}\\0&0&0&1\!\!&\vline\!\!&1\end{array}\!\right]$

$\displaystyle \mathop{\sim}^{{}^{\bold{9)}}}\left[\!\begin{array}{*{20}{r}}1&{-1}&{-1}&0\!\!&\vline\!\!&8\\0&1&{-2}&0\!\!&\vline\!\!&{-2}\\0&0&1&0\!\!&\vline\!\!&{-1}\\0&0&0&1\!\!&\vline\!\!&1\end{array}\!\right]\mathop{\sim}^{{}^{\bold{10)}}} \left[\!\begin{array}{*{20}{r}}1&{-1}&0&0\!\!&\vline\!\!&7\\0&1&0&0\!\!&\vline\!\!&{-4}\\0&0&1&0\!\!&\vline\!\!&{-1}\\0&0&0&1\!\!&\vline\!\!&1\end{array}\!\right]\mathop{\sim}^{{}^{\bold{11)}}} \left[\!\begin{array}{*{20}{r}} 1&0&0&0&\!\!\vline&\!\!3\\ 0&1&0&0&\!\!\vline&\!\!{-4}\\ 0&0&1&0&\!\!\vline&\!\!{-1}\\ 0&0&0&1&\!\!\vline&\!\!1\end{array}\!\right]$

4. ## Re: System of linear equations using matrices

I take it we could have stopped at stage 7 and said d=1, c-13d=-14 etc.

5. ## Re: System of linear equations using matrices

Yes, once you have a matrix row-reduced to upper (or lower) triangular form, you can solve the set of equations by "back-substitution".

Actually, I find the method a little bit peculiar- but perfectly valid. Personally, I tend to get the "0"s in each column, above, as well as below, the "pivot" number as I am working on the column the first time, not go through all columns getting "0" below the pivot, then back, through getting "0"s above the pivot.