Elimination solves a system by rewriting it, one step at a time, as a system that is easier to read. Each rewrite is only safe if the new system has exactly the same solutions as the old one, with nothing lost and nothing gained. Which changes have that property, and how should they be organized so that the answer can be read off at the end? This lesson answers both questions and ends every solution with a check against the original equations. Throughout, a tuple such as stands for a column vector.
Key terms
Elementary row operations
Definition The elementary row operations on a matrix are the following three.
- Interchange. Swap two rows, written .
- Scaling. Multiply one row by a nonzero number , written with .
- Row replacement. Add a multiple of one row to a different row, written with and any real number.
In a row replacement only row changes, and the source row stays as it was. On an augmented matrix each operation acts on entire rows, constants included. Each operation is undone by an operation of the same type. A swap is undone by the same swap, the scaling by , and the replacement by .
In plain words You may reorder the equations, multiply one equation by a nonzero number, or add a multiple of one equation to a different equation, leaving the equation whose multiple you added unchanged. These are moves that can always be taken back.
Example For the system , , the replacement acts on the whole second row,
The new second equation describes a different line, but that line still passes through the solution . Applying to the result brings back the original second row. The scaling would instead turn the new row into the equation .
Equivalent systems
Definition Two linear systems in the same unknowns are equivalent if they have the same solution set. Two matrices are row equivalent if one can be obtained from the other by a finite sequence of elementary row operations. If the augmented matrices of two systems are row equivalent, the two systems are equivalent. The reason is that each operation turns true equations into true equations, so every solution of the old system solves the new one, and the reverse operation shows that every solution of the new system solves the old one.
In plain words Row operations may change the individual equations and the lines or planes they describe, but never the set of points that satisfy all of the equations together.
Example The pair , and the pair , are equivalent, since the second pair comes from the first by . Both have the single solution . Keeping only the sum is not a row operation, because it discards an equation, and indeed the point satisfies but fails both and . Multiplying the second row by is not allowed either. It turns into . After that, every row that further row operations produce is a multiple of the row of , so the lost equation never comes back.
Elementary matrix
Definition An elementary matrix is a matrix obtained from an identity matrix by a single elementary row operation. If is obtained from by an operation and is any matrix, then is the result of applying the same operation to . For a system the operation produces , which amounts to . Every elementary matrix is invertible, and its inverse is the elementary matrix of the reverse operation. If operations with elementary matrices are applied in that order, the result is , with the first operation on the right.
In plain words A row operation is a multiplication on the left. Perform the operation once on the identity matrix, and the matrix you get performs it on any matrix with the same number of rows. Multiplying on the right would combine columns instead.
Example Applying to gives , and the reverse operation gives ,
Multiplying them in either order gives . For a coefficient matrix ,
which is with its second row replaced by row 2 minus twice row 1. The same sends the right-hand side to .
Row echelon form
Definition The leading entry of a nonzero row is its leftmost nonzero entry. A matrix is in row echelon form if
- every row of zeros lies below every nonzero row,
- the leading entry of each nonzero row lies in a column strictly to the right of the leading entry of the row above it, and
- every entry below a leading entry is zero.
The leading entries of a matrix in row echelon form are its pivots. They need not equal , and the entries above them need not be zero. A system is in echelon form when its augmented matrix is in row echelon form.
In plain words The nonzero entries form a staircase that steps down and to the right, with only zeros beneath it.
Example The augmented matrix
is in row echelon form, with pivots , and in the first three columns. By contrast, the matrix
is not, because the leading entry of its second row lies to the left of the leading entry of the first. Swapping the two rows repairs this.
Gaussian elimination
Definition Gaussian elimination solves a linear system in two stages. The forward stage reduces the augmented matrix to row echelon form, one column at a time.
- Find the leftmost column that has a nonzero entry in the rows not yet used.
- If the top unused row has a zero in that column, swap it with a lower row that has a nonzero entry there. The entry of the top unused row in that column is now nonzero, and it is the pivot.
- Use row replacements to make every entry below the pivot zero.
- Leave the pivot row as it is and repeat steps 1 to 3 on the rows below it, until no rows remain or the remaining rows are all zero.
The backward stage solves the echelon system by back-substitution. If the echelon form has a row that stands for an equation with , the system has no solution and there is nothing to substitute. Every matrix can be reduced to row echelon form this way, and since only elementary row operations are used, the echelon system is equivalent to the original one.
In plain words Use the first equation to remove the first unknown from every equation below it, then use the next equation to remove the next unknown, and so on down the staircase. A zero where a pivot should go is no reason to give up. Swap in a lower row that has a nonzero entry in that column, and if no lower row has one, move on to the next column.
Example Solve , , . The replacements and clear the first column, and clears the entry below the second pivot,
In the last step the new constant is , a place where a sign error is easy to make. In matrix language the three steps multiply on the left by , where , and are the elementary matrices of the three steps in the order they were applied.
Back-substitution
Definition Back-substitution solves a consistent system in echelon form from the bottom up. Solve the last nonzero equation for its pivot variable, substitute the result into the equation above, solve that equation for its pivot variable, and continue upward, each time substituting every value already found. When the system has equations in unknowns and its pivots lie on the diagonal, the equation in row reads , and
for . Every pivot is nonzero, so each division is allowed and the solution is unique. If some unknowns have no pivot, the same upward pass expresses the pivot variables in terms of them.
In plain words The lowest nonzero equation starts farthest to the right, so it involves only the last unknowns. Start there and carry every value you find into each equation above it. The last column of the echelon matrix holds the constants of the echelon system, and in general these are not the values of the unknowns.
Example In the echelon system above, the last equation gives . The second equation then gives , and the first equation gives . The solution is in the order . Check it in the original equations, not only in the echelon ones. Indeed , then , and .
Check yourself
- Write the elementary matrix for and its inverse. Then do the same for the swap .
Show the answer
Apply each operation to . The replacement and its reverse give
The swap gives the matrix below, and it is its own inverse, because swapping the same two rows twice restores every matrix,
- To solve , , a student applies to the coefficients only and writes the new second equation as . What goes wrong, and what is the correct solution?
Show the answer
A row replacement acts on the whole row, so the constant must change too, from to . The correct new equation is , and then gives . Check that and .
The student’s value leads to , and then , not . Leaving the constant behind replaced the system by one that is not equivalent to it.
- Solve the system , , by Gaussian elimination and back-substitution, and check your answer.
Show the answer
The first equation has no term, so the top entry of the first column is zero. Swap , then apply and ,
Back-substitution gives , then so , then so . The solution is . The swap reordered the equations, not the unknowns, so the entries stay in the order . In the original equations, , then , and .