Kurzius Math Notes

1.7 Solving Linear Systems Using Matrices

We’ve already seen matrices and have gone over how to solve linear systems, so most of this section will be extra practice. The only catch it that we’ll do it all with matrices.

Matrix Row Operations

Last section we went over operations on linear systems, and these carry over to matrices as well, with one addition: row switching. This does exactly what you think it does.

\[\left[\begin{array}{cc|c} a & b & c \\ d & e & f \end{array}\right] \Rightarrow \left[\begin{array}{cc|c} d & e & f \\ a & b & c \end{array}\right]\]

And it’s worth repeating the other two operations: multiplying or dividing (or scaling), and adding/subtracting rows

Reduced Row Echelon Form

Given a system like this

\[\left[ \begin{array}{ccc|c} 1 & 1 & 2 & 13 \\ 0 & 2 & 1 & 5 \\ 2 & -1 & 0 & 6 \end{array} \right]\]

the ultimate goal is

\[\left[ \begin{array}{ccc|c} 1 & 0 & 0 & 3 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 5 \end{array} \right]\]

as this represents the solution to the system. This matrix form is called reduced row echelon form. Of course, getting to that point is the trick.

There is a general strategy to get that done.

  1. Look at row 1, column 1.
  2. Make sure there is a non-zero value in this spot. If not, switch with a another row below it.
  3. Through a combination of multiplying and adding rows, reduce the values directly below it to 0.
  4. Now look at row 2, column 2.
  5. Repeat steps 2 and 3.
  6. Follow this pattern until you are at the bottom row.

That’s part 1. Let’s go through the example to see what that looks like before moving on to part 2.

\[\begin{align*} & \left[ \begin{array}{ccc|c} 1 & 1 & 2 & 13 \\ 0 & 2 & 1 & 5 \\ 2 & -1 & 0 & 6 \end{array} \right] \\ & \left[ \begin{array}{ccc|c} 2 & 2 & 4 & 26 \\ 0 & 2 & 1 & 5 \\ 2 & -1 & 0 & 6 \end{array} \right] && R_1 = 2R_1 \\ & \left[ \begin{array}{ccc|c} 2 & 2 & 4 & 26 \\ 0 & 2 & 1 & 5 \\ 0 & -3 & -4 & -20 \end{array} \right] && R_3 = R_3-R_1 \end{align*}\]

Column 1 is finished, so we move to row 2, column 2 at a reference.

\[\begin{align*} & \left[ \begin{array}{ccc|c} 2 & 2 & 4 & 26 \\ 0 & 2 & 1 & 5 \\ 0 & -3 & -4 & -20 \end{array} \right] && R_3 = R_3-R_1 \\ & \left[ \begin{array}{ccc|c} 2 & 2 & 4 & 26 \\ 0 & 6 & 3 & 15 \\ 0 & 6 & 8 & 40 \end{array} \right] && R_2 = 3R_2 \quad \text{and}\quad R3=-2R_3 \\ & \left[ \begin{array}{ccc|c} 2 & 2 & 4 & 26 \\ 0 & 6 & 3 & 15 \\ 0 & 0 & 5 & 25 \end{array} \right] && R_3=R_3-R_2 \end{align*}\]

We’ve reached the last row, so it’s time to work our way back up.

  1. Look at the last row, which should only have a value in the last column (we’re ignoring the constant column)
  2. Use a combination of multiplication and adding rows to eliminate the values above that one.
  3. Move up a row and back a column and repeat.

Also worth mentioning, is that it’s often beneficial to reduce rows when you can. Makes the math easier later on.

\[\begin{align*} & \left[ \begin{array}{ccc|c} 2 & 2 & 4 & 26 \\ 0 & 2 & 1 & 5 \\ 0 & 0 & 1 & 5 \end{array} \right] && \text{Reduced both $R_2$ and $R_3$} \\ & \left[ \begin{array}{ccc|c} 2 & 2 & 4 & 26 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 1 & 5 \end{array} \right] && R_2=R_2-R_3 \\ & \left[ \begin{array}{ccc|c} 2 & 2 & 0 & 6 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 1 & 5 \end{array} \right] && R_1=R_1-4R_3 \\ & \left[ \begin{array}{ccc|c} 2 & 0 & 0 & 6 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 1 & 5 \end{array} \right] && R_1=R_1-R_2 \\ & \left[ \begin{array}{ccc|c} 1 & 0 & 0 & 3 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 5 \end{array} \right] && \text{Reduction} \end{align*}\]

So our solution is $x=3,y=0,z=5$.

But, Why?

Last section I gave you this version:

  1. Eliminate the same variable from two of the equations.
  2. With those two equations down to two variables, solve that sub-system.
  3. Use your solutions to find the third value.

Which is basically what we did above. We eliminated $x$ from two of the rows, then got those two rows to have a single value, and then tackled the first row.

What’s nice about the version above is that it can be refined even further into an algorithm a computer can execute. Once you become proficient at math, it becomes easier to break seeming complicated problems into simple steps, and then you can make a computer do it for you.