math.wiki
Linear algebra › Row reduction › Echelon forms and Gaussian elimination
Open on the map
Precalculus

Echelon forms and Gaussian elimination

Row operations never change the solutions, but which shape should they aim for, so that the solution can simply be read off?

Where you are 7 in Row reduction

Why this exists

Row operations change an augmented matrix without changing the solutions of its system, but there are endless ways to apply them and most of them wander. What was missing is a target, a shape from which the solution can be read with almost no work, and a strategy that reaches it every time. The target is a staircase of zeros in the lower left: a last equation in one variable, the one above it in two, and so on.

Definition

In a nonzero row of a matrix, the leading entry is the first entry, reading from the left, that is not 0. A row of all zeros has no leading entry.

A matrix is in row echelon form (echelon form, for short) when

  • every row of all zeros sits below every nonzero row, and
  • each leading entry lies in a column strictly to the right of the leading entry of the row above it.

It follows that every entry below a leading entry is 0. The position of a leading entry is a pivot, and its column a pivot column.

A matrix is in reduced row echelon form when, in addition,

  • every leading entry is 1, and
  • each leading 1 is the only nonzero entry in its column.

For an augmented matrix, the whole row, constant included, is read from left to right.

Gaussian elimination brings a matrix to echelon form: work through the columns from left to right, choose a pivot in each, and clear every entry below it with replacements R_i + cR_j \to R_i. Back-substitution then solves the system from the bottom row up. Going on to scale each pivot to 1 and clear above it as well is Gauss-Jordan elimination, and it ends in the reduced form.

Intuition

■ ∗ ∗ ∗ ∗ 0 ■ ∗ ∗ ∗ 0 0 0 ■ ∗ 0 0 0 0 0 row echelon form 1 0 ∗ 0 ∗ 0 1 ∗ 0 ∗ 0 0 0 1 ∗ 0 0 0 0 0 reduced row echelon form
Figure 1Each step of the staircase moves one row down and at least one column right. A shaded square is a leading entry, never 0; a star may be any number. Reduced form makes each leading entry 1, with zeros above and below it.

A line drawn under each leading entry and down beside the next one forms a staircase. Each step goes down one row and right by one column or more, and everything below the line is 0. Read as equations, each step down the staircase drops at least one variable, so the bottom nonzero row has the fewest and is solved first.

Gaussian elimination builds the staircase one step at a time. Clearing below the first pivot finishes the first column; the rows beneath are then a smaller matrix of the same kind, and the work repeats there. The reduced form goes further: each row names one variable alone, and the solution stands in the column right of the bar.

Results

Every matrix reaches echelon form. Gaussian elimination brings any matrix to a row echelon form by row operations, so the echelon system has the same solutions as the original.

Echelon form is not unique; reduced echelon form is. A matrix has many echelon forms (scale any row of one and you have another) but exactly one reduced row echelon form, however it is reached. This is stated here, not proved in general; the argument below covers only the one-solution case.

One solution from a full staircase. If a system of n equations in n variables reaches an echelon form with a pivot in each of the n columns left of the bar, it has exactly one solution, found by back-substitution. Its reduced form is the identity matrix beside the solution:

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

says x = a, y = b, z = c.

Why it is true

Elimination always succeeds. Find the leftmost column with a nonzero entry, and if the top row has 0 there, swap up a row that does not. That entry is the pivot p, and a row with entry a below it is cleared by \displaystyle R_i - \frac{a}{p}R_1 \to R_i, allowed because p \ne 0. Now set row 1 aside and repeat on the rows beneath. Those later operations add only rows that are 0 in the columns already cleared, so they never disturb a finished step. Each round fixes one more row, so the process ends; rows that became all zeros are swapped to the bottom.

Reduced form follows. Scale each pivot row by \displaystyle \frac{1}{p}, then clear above each pivot, lowest first. A pivot row has zeros left of its pivot, and zeros in the lower pivot columns already cleared, so this changes nothing in any other pivot column.

Uniqueness, one case. The general proof is left to linear algebra; here is the case this lesson uses. If a system has exactly one solution and its reduced form has a leading 1 in each column left of the bar, that form is the identity beside a column c, which says the solution is c. Row operations keep the solution, so c is the one solution of the original system, whatever operations were chosen.

Worked examples

Example 1

Recognizing the forms

Classify each matrix as reduced row echelon form, row echelon form but not reduced, or neither.

A = \begin{bmatrix} 2 & -1 & 5 \\ 0 & 3 & 1 \\ 0 & 0 & -4 \end{bmatrix} \qquad B = \begin{bmatrix} 1 & 0 & 7 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{bmatrix}
C = \begin{bmatrix} 1 & 0 & 3 & 0 \\ 0 & 1 & -2 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}
D = \begin{bmatrix} 1 & 7 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}
Solution

(a) A: Row echelon form, not reduced. The leading entries 2, 3, -4 step right, but they are not 1s and have nonzero entries above them.

(b) B: Neither. Row 3 leads in column 2, left of row 2’s leading entry in column 3.

(c) C: Reduced row echelon form. The leading 1s in columns 1, 2 and 4 are each alone in their column. Column 3 holds no pivot, so its 3 and -2 are allowed.

(d) D: Row echelon form, not reduced. The staircase is right and the leading entries are 1s, but the 7 sits above the leading 1 of row 2.

Example 2

Back-substitution

Solve the system whose augmented matrix is

\left[\begin{array}{ccc|c} 2 & 1 & -1 & 3 \\ 0 & 3 & 2 & 1 \\ 0 & 0 & -2 & -4 \end{array}\right]
Solution

The matrix is in echelon form with a pivot in each variable column. The bottom row reads -2z = -4, so z = 2. Row 2 is 3y + 2z = 1, so 3y + 4 = 1 and y = -1. Row 1 is 2x + y - z = 3, so 2x - 1 - 2 = 3 and x = 3. The solution is (3, -1, 2).

Example 3

Gaussian elimination on three equations

Solve x + 2y + z = 3, 2x + 3y - z = -2, -x + y + 2z = 3.

Solution
\left[\begin{array}{ccc|c} 1 & 2 & 1 & 3 \\ 2 & 3 & -1 & -2 \\ -1 & 1 & 2 & 3 \end{array}\right]

The first pivot is the 1 in the top left. Clear below it with R_2 - 2R_1 \to R_2 and R_3 + R_1 \to R_3:

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

The next pivot is the -1 one row down and one column right. Clear below it with R_3 + 3R_2 \to R_3: 3 - 3 = 0, 3 - 9 = -6, 6 - 24 = -18. Row 2 has 0 in column 1, so the zero already made there stays.

\left[\begin{array}{ccc|c} 1 & 2 & 1 & 3 \\ 0 & -1 & -3 & -8 \\ 0 & 0 & -6 & -18 \end{array}\right]

Back-substitute: -6z = -18 gives z = 3; -y - 9 = -8 gives y = -1; x - 2 + 3 = 3 gives x = 2. The solution is (2, -1, 3). Check in the third equation: -2 - 1 + 6 = 3.

Example 4

A zero where the pivot should be

Solve x - y + 2z = -1, 2x - 2y + z = -5, 3x + y - z = -2.

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

Clearing column 1, R_2 - 2R_1 \to R_2 gives 0 \;\; 0 \;\; -3 \mid -3 and R_3 - 3R_1 \to R_3 gives 0 \;\; 4 \;\; -7 \mid 1. The second pivot belongs in row 2, column 2, but that entry is 0, and no multiple of 0 clears the 4 beneath it. Row 3 has a nonzero entry there, so swap, R_2 \leftrightarrow R_3, and the staircase is finished:

\left[\begin{array}{ccc|c} 1 & -1 & 2 & -1 \\ 0 & 4 & -7 & 1 \\ 0 & 0 & -3 & -3 \end{array}\right]

Back-substitute: z = 1; 4y - 7 = 1 gives y = 2; x - 2 + 2 = -1 gives x = -1. The solution is (-1, 2, 1). Check in the second equation: -2 - 4 + 1 = -5.

Example 5

Two echelon forms, one reduced form

Togzhan and Wekesa both reduce the augmented matrix of 2x + 4y = 10, 3x + 5y = 11. Compare their work.

Solution

Togzhan first makes the pivot 1 with \displaystyle \frac{1}{2}R_1 \to R_1, then uses R_2 - 3R_1 \to R_2. Wekesa avoids fractions: R_1 \leftrightarrow R_2, then 3R_2 \to R_2 and R_2 - 2R_1 \to R_2.

\text{Togzhan: } \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 0 & -1 & -4 \end{array}\right]
\text{Wekesa: } \left[\begin{array}{cc|c} 3 & 5 & 11 \\ 0 & 2 & 8 \end{array}\right]

Both are echelon forms, and they are different matrices. Both give y = 4, and then x + 8 = 5 or 3x + 20 = 11, so x = -3 either way. Togzhan reaches the reduced form with -R_2 \to R_2 and R_1 - 2R_2 \to R_1; Wekesa with \displaystyle \frac{1}{2}R_2 \to R_2, R_1 - 5R_2 \to R_1 and \displaystyle \frac{1}{3}R_1 \to R_1. Both arrive at

\left[\begin{array}{cc|c} 1 & 0 & -3 \\ 0 & 1 & 4 \end{array}\right]

which reads x = -3, y = 4. Check: 2(-3) + 4(4) = 10 and 3(-3) + 5(4) = 11.

Example 6

Gauss-Jordan elimination at the bindery

Tyyne’s bookbinding studio sewed 50 notebooks in three sizes. A pocket notebook uses 3 folded sections of paper and 1 meter of thread, a journal 4 sections and 2 meters, a ledger 6 sections and 3 meters. The day used 210 sections and 95 meters of thread. How many of each size were made?

Solution

Let p, j and l count pocket notebooks, journals and ledgers. Counting notebooks, sections and meters:

\left[\begin{array}{ccc|c} 1 & 1 & 1 & 50 \\ 3 & 4 & 6 & 210 \\ 1 & 2 & 3 & 95 \end{array}\right]

R_2 - 3R_1 \to R_2 and R_3 - R_1 \to R_3 give 0 \;\; 1 \;\; 3 \mid 60 and 0 \;\; 1 \;\; 2 \mid 45; then R_3 - R_2 \to R_3 gives 0 \;\; 0 \;\; -1 \mid -15. That is echelon form, and this time the work goes on to reduced form.

-R_3 \to R_3 makes the last pivot 1. Clearing above it, R_2 - 3R_3 \to R_2 gives 0 \;\; 1 \;\; 0 \mid 15 and R_1 - R_3 \to R_1 gives 1 \;\; 1 \;\; 0 \mid 35. Clearing above the second pivot, R_1 - R_2 \to R_1 gives 1 \;\; 0 \;\; 0 \mid 20.

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

Tyyne made 20 pocket notebooks, 15 journals and 15 ledgers. Check: 60 + 60 + 90 = 210 and 20 + 30 + 45 = 95.

Boundaries

  • A shape, not a solution. Systems with no solution or infinitely many also have echelon forms. This lesson keeps to a pivot in every variable column, which means exactly one solution; the other cases are read in Solving a system by row reduction: one, none or infinitely many solutions.
  • A pivot is never 0. A zero in the pivot position is dealt with by a swap. If the column is 0 from the pivot row down, it has no pivot and the staircase steps further right.
  • Conventions differ. Some books also require leading 1s in echelon form; here that belongs to the reduced form only.
  • Exact arithmetic. A calculator working in decimals rounds, and an entry that should be 0 can appear as a tiny pivot.

Where this goes next

Solving a system by row reduction: one, none or infinitely many solutions reads one, none or infinitely many solutions from the final rows, and Solving a system by row reduction: one, none or infinitely many solutions describes columns with no pivot. The reduced form is studied in its own right in Reduced row echelon form, and counting pivots gives the rank. Gaussian elimination is the organized form of the work in Systems in three variables.

Exercises

Recognizing the forms

For exercises 1 to 6, classify the matrix as reduced row echelon form, row echelon form but not reduced, or neither, and give the reason.

  1. \begin{bmatrix} 1 & 5 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix}
  2. \begin{bmatrix} 4 & 1 & 2 \\ 0 & 0 & 3 \\ 0 & 6 & 1 \end{bmatrix}
  3. \begin{bmatrix} 1 & 0 & -5 \\ 0 & 1 & 6 \\ 0 & 0 & 5 \end{bmatrix}
  4. \begin{bmatrix} 0 & 0 & 0 \\ 1 & 2 & 5 \\ 0 & 0 & 1 \end{bmatrix}
  5. \begin{bmatrix} 1 & 6 & 0 & -2 \\ 0 & 0 & 1 & 3 \end{bmatrix}
  6. \begin{bmatrix} 1 & -5 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}

Back-substitution

Solve the system with each augmented matrix.

  1. \left[\begin{array}{cc|c} 1 & -3 & 7 \\ 0 & 2 & -4 \end{array}\right]
  2. \left[\begin{array}{ccc|c} 1 & 2 & -1 & 4 \\ 0 & 1 & 3 & 5 \\ 0 & 0 & 2 & 4 \end{array}\right]
  3. \left[\begin{array}{ccc|c} 3 & -1 & 2 & 1 \\ 0 & -2 & 1 & 3 \\ 0 & 0 & 4 & -4 \end{array}\right]

Gaussian elimination

Reduce to echelon form, naming each operation, and back-substitute.

  1. x + 3y = -1, 4x + 5y = 3
  2. 3x + 2y = 1, x - y = 2
  3. x + y - z = 2, 2x + 3y + z = 7, -x + 2y + 3z = 0
  4. x + 2y + z = 1, 2x + 4y + 3z = 4, x + 3y - z = -4
  5. 2y + z = 1, x + y + z = 2, 3x - y + 2z = 3

All the way to reduced form

  1. Take \left[\begin{array}{ccc|c} 1 & -2 & 1 & -2 \\ 0 & 1 & -1 & 1 \\ 0 & 0 & 1 & 2 \end{array}\right] to reduced row echelon form and read off the solution.
  2. Take the augmented matrix of 2x + 6y = 8, 3x + 7y = 4 to reduced row echelon form and read off the solution.
  3. Wekesa buys 15 sheets of cover material for the bindery: buckram (a stiff cloth) at 10 dollars a sheet, linen at 30 dollars and leather at 40 dollars, 360 dollars in all, with twice as many buckram sheets as leather. Write the augmented matrix in the order b, n, h (buckram, linen, leather), reduce it, and find each count.

Reasoning

  1. For x + y = 5, 2x + 4y = 14, Togzhan reaches \left[\begin{array}{cc|c} 1 & 1 & 5 \\ 0 & 2 & 4 \end{array}\right] and Wekesa reaches \left[\begin{array}{cc|c} 2 & 4 & 14 \\ 0 & -1 & -2 \end{array}\right]. Show that each is an echelon form reached by row operations, and that both have the same reduced form.
  2. Explain why, in an echelon form, every entry below a leading entry is 0.
  3. In Gaussian elimination, the second pivot row is used to clear column 2. Explain why this cannot undo the zeros already made in column 1.
  4. Tyyne says a square matrix in reduced row echelon form with a pivot in every column must be the identity matrix. Explain why she is right.
Answers
  1. Reduced row echelon form. Leading 1s in columns 1 and 3, each alone in its column, zero row at the bottom; column 2 has no pivot, so its 5 is allowed.
  2. Neither. Row 3 leads in column 2, left of row 2’s leading entry.
  3. Row echelon form, not reduced. The leading 5 is not 1, and -5 and 6 sit above it.
  4. Neither. The zero row is above nonzero rows.
  5. Reduced row echelon form. Leading 1s in columns 1 and 3, each alone in its column.
  6. Row echelon form, not reduced. The -5 sits above the leading 1 of row 2.
  7. (1, -2). 2y = -4 gives y = -2; x + 6 = 7 gives x = 1.
  8. (8, -1, 2). z = 2; y + 6 = 5, so y = -1; x - 2 - 2 = 4, so x = 8.
  9. \displaystyle \left(\frac{1}{3}, -2, -1\right). z = -1; -2y - 1 = 3, so y = -2; 3x + 2 - 2 = 1, so \displaystyle x = \frac{1}{3}.
  10. (2, -1). R_2 - 4R_1 \to R_2 gives 0 \;\; -7 \mid 7, so y = -1 and x = -1 + 3 = 2.
  11. (1, -1). R_1 \leftrightarrow R_2, then R_2 - 3R_1 \to R_2 gives 0 \;\; 5 \mid -5, so y = -1 and x = 1.
  12. (3, 0, 1). R_2 - 2R_1 \to R_2, R_3 + R_1 \to R_3, then R_3 - 3R_2 \to R_3 gives 0 \;\; 0 \;\; -7 \mid -7. So z = 1, y + 3 = 3 gives y = 0, and x = 3.
  13. (1, -1, 2). R_2 - 2R_1 \to R_2 and R_3 - R_1 \to R_3 give 0 \;\; 0 \;\; 1 \mid 2 and 0 \;\; 1 \;\; -2 \mid -5; R_2 \leftrightarrow R_3 finishes the staircase. So z = 2, y = -1, x = 1.
  14. (2, 1, -1). R_1 \leftrightarrow R_2 puts a nonzero entry top left. R_3 - 3R_1 \to R_3 gives 0 \;\; -4 \;\; -1 \mid -3, and R_3 + 2R_2 \to R_3 gives 0 \;\; 0 \;\; 1 \mid -1. So z = -1, 2y - 1 = 1 gives y = 1, and x = 2.
  15. (2, 3, 2). R_2 + R_3 \to R_2 gives 0 \;\; 1 \;\; 0 \mid 3; R_1 - R_3 \to R_1 gives 1 \;\; -2 \;\; 0 \mid -4; R_1 + 2R_2 \to R_1 gives 1 \;\; 0 \;\; 0 \mid 2.
  16. (-8, 4). \displaystyle \frac{1}{2}R_1 \to R_1, then R_2 - 3R_1 \to R_2 gives 0 \;\; -2 \mid -8; \displaystyle -\frac{1}{2}R_2 \to R_2 and R_1 - 3R_2 \to R_1 leave 1 \;\; 0 \mid -8 and 0 \;\; 1 \mid 4.
  17. 6 buckram, 6 linen, 3 leather. The matrix is \left[\begin{array}{ccc|c} 1 & 1 & 1 & 15 \\ 10 & 30 & 40 & 360 \\ 1 & 0 & -2 & 0 \end{array}\right]. \displaystyle \frac{1}{10}R_2 \to R_2, R_2 - R_1 \to R_2, R_3 - R_1 \to R_3, R_2 \leftrightarrow R_3 and R_3 + 2R_2 \to R_3 leave rows 0 \;\; -1 \;\; -3 \mid -15 and 0 \;\; 0 \;\; -3 \mid -9. So h = 3, n = 6, b = 6. Check: 60 + 180 + 120 = 360.
  18. Togzhan used R_2 - 2R_1 \to R_2; Wekesa R_1 \leftrightarrow R_2, then \displaystyle R_2 - \frac{1}{2}R_1 \to R_2. Both have a staircase. Togzhan’s reduces by \displaystyle \frac{1}{2}R_2 \to R_2 and R_1 - R_2 \to R_1; Wekesa’s by -R_2 \to R_2, R_1 - 4R_2 \to R_1 and \displaystyle \frac{1}{2}R_1 \to R_1. Both give \left[\begin{array}{cc|c} 1 & 0 & 3 \\ 0 & 1 & 2 \end{array}\right].
  19. Each lower row starts strictly further right, so all its nonzero entries lie right of that column; zero rows have none at all.
  20. The second pivot row has 0 in column 1, so adding any multiple of it adds 0 to a lower row’s column 1 entry.
  21. A pivot in each of the n columns means n pivots, one per row, and the staircase forces them onto the diagonal. Each is 1 and alone in its column, so every other entry is 0.
kg1128 · updated 2026-10-20 · CC-BY-SA-4.0