Learn Without Walls
← Lesson 1 Lesson 2 of 4 Next Lesson →

Lesson 2: Gaussian Elimination and Row Echelon Form

Estimated time: 35-45 minutes

Learning Objectives

By the end of this lesson, you will be able to:

Row Echelon Form (REF)

Gaussian elimination transforms an augmented matrix into a specific shape called row echelon form. Once in this form, the system can be solved easily by back-substitution.

Row Echelon Form (REF): A matrix is in row echelon form if:

  1. All rows of all zeros are at the bottom.
  2. The first nonzero entry (the pivot or leading entry) in each nonzero row is to the right of the pivot in the row above.
  3. All entries below a pivot are zero.

Pivot: The first nonzero entry in each row of a row echelon form. Pivots mark the "staircase" pattern descending from left to right.

Example: Matrices in REF

This matrix IS in row echelon form (pivots shown with *):

[ *1   3   2  |   5 ]
[  0  *2   1  |   3 ]
[  0   0  *4  |   8 ]

Notice the staircase: each pivot is to the right of and below the previous one, with zeros below each pivot.

This matrix is NOT in REF:

[ 1   3  |  5 ]
[ 2   1  |  7 ]

The entry below the first pivot (the 2 in row 2, column 1) is not zero.

The Gaussian Elimination Algorithm

The algorithm works left to right, top to bottom, creating zeros below each pivot:

Gaussian Elimination Steps

  1. Find the pivot: In the leftmost column that has a nonzero entry, find the topmost nonzero entry. Swap rows if necessary to move it to the current pivot row.
  2. Create zeros below the pivot: For each row below the pivot row, use row replacement to make the entry in the pivot column equal to zero.
  3. Move to the next pivot position: Move one row down and one column right. Repeat from step 1.
  4. Stop when all rows below are processed or all remaining rows are zero.

Worked Example: Full 3x3 Gaussian Elimination

Solve the system:

x + 2y + z = 9
2x + 5y + 3z = 23
-x + y + 2z = 5

Step 1: Write the augmented matrix.

[ 1   2   1  |   9 ]
[ 2   5   3  |  23 ]
[-1   1   2  |   5 ]

Step 2: Eliminate below pivot in column 1.

R_2 - 2R_1 → R_2: [2-2, 5-4, 3-2 | 23-18] = [0, 1, 1 | 5]

R_3 + R_1 → R_3: [-1+1, 1+2, 2+1 | 5+9] = [0, 3, 3 | 14]

[ 1   2   1  |   9 ]
[ 0   1   1  |   5 ]
[ 0   3   3  |  14 ]

Step 3: Eliminate below pivot in column 2.

R_3 - 3R_2 → R_3: [0-0, 3-3, 3-3 | 14-15] = [0, 0, 0 | -1]

[ 1   2   1  |   9 ]
[ 0   1   1  |   5 ]
[ 0   0   0  |  -1 ]

Step 4: Interpret.

Row 3 says 0x + 0y + 0z = -1, which simplifies to 0 = -1. This is a contradiction!

This system has no solution (it is inconsistent).

Worked Example: A Consistent 3x3 System

Solve:

x + y + z = 6
2x + 3y + z = 14
x + 2y - z = 2

Augmented matrix:

[ 1   1   1  |   6 ]
[ 2   3   1  |  14 ]
[ 1   2  -1  |   2 ]

R_2 - 2R_1 → R_2 and R_3 - R_1 → R_3:

[ 1   1   1  |  6 ]
[ 0   1  -1  |  2 ]
[ 0   1  -2  |  -4 ]

R_3 - R_2 → R_3:

[ 1   1   1  |  6 ]
[ 0   1  -1  |  2 ]
[ 0   0  -1  |  -6 ]

Back-substitution:

From row 3: -z = -6, so z = 6.

From row 2: y - z = 2, so y = 2 + 6 = 8. Wait, let me recheck. y - 6 = 2, so y = 8.

From row 1: x + y + z = 6, so x + 8 + 6 = 6, x = -8.

Solution: (x, y, z) = (-8, 8, 6).

Verify in original equation 2: 2(-8) + 3(8) + 6 = -16 + 24 + 6 = 14. ✓

Back-Substitution

Once in REF, solve from the bottom row up:

  1. The bottom nonzero row gives one variable directly (or detects a contradiction).
  2. Substitute that value into the row above to find the next variable.
  3. Continue upward until all variables are found.

This is called back-substitution because you work backwards through the rows.

Check Your Understanding

1. Is this matrix in row echelon form? [ 1 2 3 | 4 ] / [ 0 0 5 | 2 ] / [ 0 1 0 | 3 ]

Answer: No. The pivot in row 3 (the 1 in column 2) is not to the right of the pivot in row 2 (the 5 in column 3). In fact, the pivot in row 3 is to the LEFT of the pivot in row 2. The rows would need to be swapped.

2. Apply Gaussian elimination to: [ 1 -1 | 3 ] / [ 2 1 | 9 ]. Then solve by back-substitution.

Answer: R_2 - 2R_1 → R_2: [0, 1+2 | 9-6] = [0, 3 | 3]. So: [ 1 -1 | 3 ] / [ 0 3 | 3 ]. From row 2: 3y = 3, y = 1. From row 1: x - 1 = 3, x = 4. Solution: (4, 1).

3. What does a row [0 0 0 | 5] in REF tell you about the system?

Answer: It represents the equation 0 = 5, which is impossible. The system is inconsistent (has no solution).

4. What does a row [0 0 0 | 0] in REF tell you?

Answer: It represents 0 = 0, which is always true. This row provides no new information. It typically means the system has either a free variable (infinitely many solutions) or was redundant.

Key Takeaways

Next Lesson

In Lesson 3, learn Gauss-Jordan elimination to reach reduced row echelon form, where solutions can be read off directly.

Start Lesson 3

Module Home

Module 1 Home