In Section LinSystems we introduced Gaussian Elimination as a means of transforming a system of linear equations into triangular form with the ultimate goal of producing an equivalent system of linear equations which is easier to solve. If we take a step back and study the process, we see that all of our moves are determined entirely by the coefficients of the variables involved, and not the variables themselves. Much the same thing happened when we studied long division in Section Polydivision. Just as we developed synthetic division to streamline that process, in this section, we introduce a similar bookkeeping device to help us solve systems of linear equations, the matrix.

A matrix as a rectangular array of real numbers. We typically enclose matrices with ‘square brackets’ of the likes of ‘\(\left [ \right .\)’ and ‘\(\left . \right ]\)’, and we size matrices by the number of rows and columns they have. For example, the size (sometimes called the dimension) of

\[ \left [ \begin{array}{rrr} 3 & 0 & -1 \\ 2 & -5 & 10 \end{array} \right ]\]

is \(2 \times 3\) because it has \(2\) rows and \(3\) columns. The individual numbers in a matrix are called its entries and are usually labeled with double subscripts: the first tells which row the element is in and the second tells which column it is in. The rows are numbered from top to bottom and the columns are numbered from left to right. Matrices themselves are usually denoted by uppercase letters (\(A\), \(B\), \(C\), etc.) while their entries are usually denoted by the corresponding letter. So, for instance, if we have

\[ A = \left [ \begin{array}{rrr} 3 & 0 & -1 \\ 2 & -5 & 10 \end{array} \right ]\]

then \(a_{11} = 3\), \(a_{12} = 0\), \(a_{13} = -1\), \(a_{21} = 2\), \(a_{22} = -5\), and \(a_{23} = 10\). We shall explore matrices as mathematical objects with their own algebra in Section MatArithmetic and introduce them here solely as a bookkeeping device. Consider the system of linear equations from number 2 in Example GaussEqnEx

\[\left \{ \begin{array}{lrcr} (E1) & 2x+3y-z & = & 1 \\ (E2) & 10x-z & = & 2 \\ (E3) & 4x-9y+2z & = & 5 \\ \end{array} \right .\]

We encode this system into a matrix by assigning each equation to a corresponding row. Within that row, each variable and the constant gets its own column, and to separate the variables on the left hand side of the equation from the constants on the right hand side, we use a vertical bar, \(|\). Note that in \(E2\), since \(y\) is not present, we record its coefficient as \(0\). The matrix associated with this system is

\[ \begin{array}{c} \begin{array}{rrrrrrr} & & & \hspace {.33in} x & \hspace {.12in} y & \hspace {.1in} z & \hspace {.03in} c \\ \end{array} \\ \begin{array}{r} (E1) \rightarrow \\ (E2) \rightarrow \\ (E3) \rightarrow \end{array} \left [ \begin{array}{rrr|r} 2 & 3 & -1 & 1\\ 10 & 0 & -1 & 2 \\ 4 & -9 & 2 & 5 \end{array} \right ] \end{array} \]

This matrix is called an augmented matrix because the column containing the constants is appended to the matrix containing the coefficients. To solve this system, we can use the same kind operations on the rows of the matrix that we performed on the equations of the system. More specifically, we have the following analog of Theorem equationmoves below.

As a demonstration of the moves in Theorem rowops, we revisit some of the steps that were used in solving the systems of linear equations in Example GaussEqnEx of Section LinSystems. The reader is encouraged to perform the indicated operations on the rows of the augmented matrix to see that the machinations are identical to what is done to the coefficients of the variables in the equations. We first see a demonstration of switching two rows using the first step of part 1 in Example GaussEqnEx.

\[\begin{array}{ccc} \left \{ \begin{array}{lrcr} (E1) & 3x-y+z & = & 3 \\ (E2) & 2x-4y+3z & = & 16 \\ (E3) & x-y+z & = & 5 \\ \end{array} \right . & \xrightarrow {\text {Switch $E1$ and $E3$}} & \left \{ \begin{array}{lrcr} (E1) & x-y+z & = & 5 \\ (E2) & 2x-4y+3z & = & 16 \\ (E3) & 3x-y+z & = & 3 \\ \end{array} \right . \end{array}\]
\[\begin{array}{ccc} \left [ \begin{array}{rrr|r} 3 & -1 & \hphantom {-}1 & 3 \\ 2 & -4 & 3 & 16 \\ 1 & -1 & 1 & 5 \\ \end{array} \right ] & \xrightarrow {\text {Switch $R1$ and $R3$}} & \left [ \begin{array}{rrr|r} 1 & -1 & \hphantom {-}1 & 5 \\ 2 & -4 & 3 & 16 \\ 3 & -1 & 1 & 3 \\ \end{array} \right ] \end{array}\]

Next, we have a demonstration of replacing a row with a nonzero multiple of itself using the first step of part 3 in Example GaussEqnEx.

\[\begin{array}{ccc} \left \{ \begin{array}{lrcr} (E1) & 3x_1 +x_2 + x_4 & = & 6 \\ (E2) & 2x_1 + x_2 -x_3 & = & 4 \\ (E3) & x_2 -3x_3 -2x_4 & = & 0 \\ \end{array} \right . & \xrightarrow {\text {Replace $E1$ with $\frac {1}{3}E1$}} & \left \{ \begin{array}{lrcr} (E1) & x_1 + \frac {1}{3}x_2 + \frac {1}{3}x_4 & = & 2 \\ (E2) & 2x_1 + x_2 -x_3 & = & 4 \\ (E3) & x_2 -3x_3 -2x_4 & = & 0 \\ \end{array} \right . \end{array}\]
\[\begin{array}{ccc} \left [ \begin{array}{rrrr|r} 3 & \hphantom {-} 1 & 0 & 1 & 6 \\ 2 & 1 & -1 & 0 & 4 \\ 0 & 1 & -3 & -2 & 0 \\ \end{array} \right ] & \xrightarrow {\text {Replace $R1$ with $\frac {1}{3}R1$}} & \left [ \begin{array}{rrrr|r} 1 & \frac {1}{3} & 0 & \frac {1}{3} & 2 \\ 2 & \hphantom {-}1 & -1 & 0 & 4 \\ 0 & 1 & -3 & -2 & 0 \\ \end{array} \right ] \end{array}\]

Finally, we have an example of replacing a row with itself plus a multiple of another row using the second step from part 2 in Example GaussEqnEx.

\[ \begin{array}{ccc} \left \{ \begin{array}{lrcr} (E1) & x+\frac {3}{2}y-\frac {1}{2}z & = & \frac {1}{2} \\ (E2) & 10x-z & = & 2 \\ (E3) & 4x-9y+2z & = & 5 \\ \end{array} \right . & \xrightarrow [\text {Replace $E3$ with $-4E1 + E3$}]{\text {Replace $E2$ with $-10E1 + E2$}} & \left \{ \begin{array}{lrcr} (E1) & x+\frac {3}{2}y-\frac {1}{2}z & = & \frac {1}{2} \\ (E2) & -15y+4z & = & -3 \\ (E3) & -15y+4z & = & 3 \\ \end{array} \right . \end{array} \]
\[\begin{array}{ccc} \left [ \begin{array}{rrr|r} 1 & \frac {3}{2} & -\frac {1}{2} & \frac {1}{2} \\ 10 & 0 & -1 & 2 \\ 4 & -9 & 2 & 5 \\ \end{array} \right ] & \xrightarrow [\text {Replace $R3$ with $-4R1 + R3$}]{\text {Replace $R2$ with $-10R1 + R2$}} & \left [ \begin{array}{rrr|r} 1 & \frac {3}{2} & -\frac {1}{2} & \frac {1}{2} \\ 0 & -15 & 4 & -3 \\ 0 & -15 & 4 & 3 \\ \end{array} \right ] \end{array}\]

The matrix equivalent of ‘triangular form’ is row echelon form. The reader is encouraged to refer to Definition systemtriangularform for comparison. Note that the analog of ‘leading variable’ of an equation is ‘leading entry’ of a row. Specifically, the first nonzero entry (if it exists) in a row is called the leading entry of that row.

To solve a system of a linear equations using an augmented matrix, we encode the system into an augmented matrix and apply Gaussian Elimination to the rows to get the matrix into row-echelon form. We then decode the matrix and back substitute. The next example illustrates this nicely.

As part of Gaussian Elimination, we used row operations to obtain \(0\)’s beneath each leading \(1\) to put the matrix into row echelon form. If we also require that \(0\)’s are the only numbers above a leading \(1\), we have what is known as the reduced row echelon form of the matrix.

Of what significance is the reduced row echelon form of a matrix? To illustrate, let’s take the row echelon form from Example GaussExMatrix and perform the necessary steps to put into reduced row echelon form. We start by using the leading \(1\) in \(R3\) to zero out the numbers in the rows above it.

\[ \begin{array}{ccc} \left [ \begin{array}{rrr|r} 1 & \hphantom {-}2 & -1 & 4 \\ 0 & 1 & -\frac {4}{7} & \frac {4}{7} \\ 0 & 0 &1 & -1 \\ \end{array} \right ] & \xrightarrow [\text {Replace $R2$ with $\frac {4}{7} R3 + R2$}]{\text {Replace $R1$ with $R3+R1$}} & \left [ \begin{array}{rrr|r} 1 & 2 & 0 & 3 \\ 0 & 1 & 0 & 0 \\ 0 & 0 &1 & -1 \\ \end{array} \right ] \end{array}\]

Finally, we take care of the \(2\) in \(R1\) above the leading \(1\) in \(R2\).

\[ \begin{array}{ccc} \left [ \begin{array}{rrr|r} 1 & 2 & 0 & 3 \\ 0 & 1 & 0 & 0 \\ 0 & 0 &1 & -1 \\ \end{array} \right ] & \xrightarrow {\text {Replace $R1$ with $-2R2+R1$}} & \left [ \begin{array}{rrr|r} 1 & 0 & 0 & 3 \\ 0 & 1 & 0 & 0 \\ 0 & 0 &1 & -1 \\ \end{array} \right ] \end{array}\]

To our surprise and delight, when we decode this matrix, we obtain the solution instantly without having to deal with any back-substitution at all.

\[ \begin{array}{ccc} \left [ \begin{array}{rrr|r} 1 & 0 & 0 & 3 \\ 0 & 1 & 0 & 0 \\ 0 & 0 &1 & -1 \\ \end{array} \right ] & \xrightarrow {\text {Decode from the matrix}} & \left \{ \begin{array}{rcr} x & = & 3 \\ y & = & 0 \\ z & = & -1 \end{array} \right . \end{array}\]

Note that in the previous discussion, we could have started with \(R2\) and used it to get a zero above its leading \(1\) and then done the same for the leading \(1\) in \(R3\). By starting with \(R3\), however, we get more zeros first, and the more zeros there are, the faster the remaining calculations will be. It is also worth noting that while a matrix has several row echelon forms, it has only one reduced row echelon form. The process by which we have put a matrix into reduced row echelon form is called Gauss-Jordan Elimination.

Like all good algorithms, putting a matrix in row echelon or reduced row echelon form can easily be programmed into a calculator, and, doubtless, your graphing calculator has such a feature. We make use of thus feature in next example to avoid tedious arithmetic.