Evanalysis
2.3Embedded interactionEstimated reading time: 15 min

2.3 Gaussian elimination and RREF

Follow one full row-reduction path and learn how REF and RREF let you read a system instead of guessing.

Course contents

MATH1030: Linear algebra I

Linear algebra notes.

37 sections

Why elimination matters

When students first meet Gaussian elimination, it can feel like a pile of rules:

  • swap rows,
  • multiply a row,
  • subtract a row,
  • keep going until the matrix looks “nice.”

That is not the right mental model.

Gaussian elimination is really a reading strategy. You start with a system that is hard to read, then you use row operations to make the logical structure of the system more visible. Each row operation should answer a question such as:

  • Which variable am I trying to isolate next?
  • Which entry is blocking me?
  • Which move will create more zeros without changing the solution set?

If you keep asking those questions, elimination becomes much less mechanical.

Intuition first: what are we trying to build?

The dream shape is not “a random simpler matrix.” The dream shape is a matrix whose important columns are easy to spot and whose equations are easy to read from bottom to top.

In practice, that means:

  1. pick a pivot entry,
  2. clear the entries below it,
  3. move to the smaller submatrix that remains,
  4. then clean up above the pivots if you want full reduced form.

So elimination is a controlled way of building a staircase of pivots.

Definition

REF and RREF

A matrix is in row echelon form (REF) when:

  1. all zero rows are at the bottom, and
  2. each nonzero row starts farther to the right than the row above it.

A matrix is in reduced row echelon form (RREF) when, in addition:

  1. each pivot is 1, and
  2. each pivot is the only nonzero entry in its column.

The first nonzero entry in a nonzero row is called a pivot or leading entry. A column containing a pivot is a pivot column. Columns without a pivot correspond to free variables.

That vocabulary matters because it tells you what kind of solution set to expect later.

Theorem

Why row reduction is safe

If two augmented matrices are row-equivalent, then they represent equivalent systems of linear equations. In other words, row operations change the look of the system, but not its solution set.

This is why elimination is legitimate. We are reorganizing information, not inventing a new problem.

One full elimination path

Elimination starts from an augmented matrix and repeatedly clears the entries beneath a pivot. We will follow that idea on a small system:

x+2y+2z=4,x+3y+3z=5,2x+6y+5z=6.\begin{aligned} x + 2y + 2z &= 4, \\ x + 3y + 3z &= 5, \\ 2x + 6y + 5z &= 6. \end{aligned}

Its augmented matrix is

[122413352656].\begin{bmatrix} 1 & 2 & 2 & 4 \\ 1 & 3 & 3 & 5 \\ 2 & 6 & 5 & 6 \end{bmatrix}.

Worked example

Read every row operation as a purpose

The entry in the top-left corner is already a convenient pivot because it is 1. So the first goal is simple:

make everything below that pivot become 0.

Use

R2R2R1,R3R32R1.R_2 \leftarrow R_2 - R_1, \qquad R_3 \leftarrow R_3 - 2R_1.

Then the matrix becomes

[122401110212].\begin{bmatrix} 1 & 2 & 2 & 4 \\ 0 & 1 & 1 & 1 \\ 0 & 2 & 1 & -2 \end{bmatrix}.

Now column 1 is finished. The next pivot lives in row 2, column 2. So we use it to clear the 2 below it:

R3R32R2.R_3 \leftarrow R_3 - 2R_2.

This gives

[122401110014].\begin{bmatrix} 1 & 2 & 2 & 4 \\ 0 & 1 & 1 & 1 \\ 0 & 0 & -1 & -4 \end{bmatrix}.

At this stage the matrix is already in REF. You can solve by back-substitution. But if you want the cleanest reading form, continue to RREF.

First make the last pivot equal to 1:

R3R3[122401110014].R_3 \leftarrow -R_3 \quad\Rightarrow\quad \begin{bmatrix} 1 & 2 & 2 & 4 \\ 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 4 \end{bmatrix}.

Then clear the entries above that pivot:

R1R12R3,R2R2R3,R_1 \leftarrow R_1 - 2R_3, \qquad R_2 \leftarrow R_2 - R_3,

so the matrix becomes

[120401030014].\begin{bmatrix} 1 & 2 & 0 & -4 \\ 0 & 1 & 0 & -3 \\ 0 & 0 & 1 & 4 \end{bmatrix}.

Finally clear the 2 above the second pivot:

R1R12R2,R_1 \leftarrow R_1 - 2R_2,

which gives the RREF

[100201030014].\begin{bmatrix} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & -3 \\ 0 & 0 & 1 & 4 \end{bmatrix}.

Now the solution can be read immediately:

x=2,y=3,z=4.x = 2,\qquad y = -3,\qquad z = 4.

Notice the teaching pattern:

  • below-pivot clearing creates REF,
  • above-pivot clearing creates RREF,
  • RREF is the easiest form to read directly.

Try the same path interactively

The stepper below keeps the same logic, but slows it down. At each stage, look at three things:

  1. which pivot is active,
  2. which row operation is being applied, and
  3. what becomes easier to read afterward.

Read and try

Trace one full row-reduction path

The live stepper walks through one complete elimination path, showing the row operation, the pivot you are focusing on, and the matrix produced at each step.

1224
1335
2656

Row operation

Choose the first pivot in column 1.

What to notice

Column 1 already has a convenient pivot 1 in the first row, so we do not need a row swap.

Start with the augmented matrix. The first pivot should help us clear the entries underneath it.

A longer assignment-style reduction

Short examples are useful for learning the mechanics, but assignment problems usually test whether you can keep the whole reduction organized. The main danger is not the size of the numbers. The main danger is losing the purpose of each row operation.

Consider the augmented matrix

C=[120102112101232411251510324118].C= \begin{bmatrix} 1 & 2 & 0 & 1 & 0 & 2 & 1 \\ 1 & 2 & 1 & 0 & 1 & 2 & 3 \\ 2 & 4 & 1 & 1 & 2 & 5 & 1 \\ 5 & 10 & 3 & 2 & 4 & 11 & 8 \end{bmatrix}.

The first column already has a usable pivot in row 1. Clearing below that pivot gives

[1201021001110200112110033413].\begin{bmatrix} 1 & 2 & 0 & 1 & 0 & 2 & 1 \\ 0 & 0 & 1 & -1 & 1 & 0 & 2 \\ 0 & 0 & 1 & -1 & 2 & 1 & -1 \\ 0 & 0 & 3 & -3 & 4 & 1 & 3 \end{bmatrix}.

Now row 2 supplies the next pivot. Use it to remove the matching entries below:

R3R3R2,R4R43R2.R_3\leftarrow R_3-R_2, \qquad R_4\leftarrow R_4-3R_2.

After also clearing the duplicate row created by the next pivot, one clean echelon stage is

[1201021001110200001130000000].\begin{bmatrix} 1 & 2 & 0 & 1 & 0 & 2 & 1 \\ 0 & 0 & 1 & -1 & 1 & 0 & 2 \\ 0 & 0 & 0 & 0 & 1 & 1 & -3 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}.

This is the point where you should pause and read the structure: pivot columns are columns 1, 3, and 5; free columns are columns 2, 4, and 6. To reach RREF, clear the entry above the pivot in column 5:

R2R2R3.R_2\leftarrow R_2-R_3.

The final reduced form is

C=[1201021001101500001130000000].C'= \begin{bmatrix} 1 & 2 & 0 & 1 & 0 & 2 & 1 \\ 0 & 0 & 1 & -1 & 0 & -1 & 5 \\ 0 & 0 & 0 & 0 & 1 & 1 & -3 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}.

Let

x2=u,x4=v,x6=w.x_2=u,\qquad x_4=v,\qquad x_6=w.

Then the pivot equations read

x1+2x2+x4+2x6=1,x3x4x6=5,x5+x6=3.\begin{aligned} x_1+2x_2+x_4+2x_6 &= 1,\\ x_3-x_4-x_6 &= 5,\\ x_5+x_6 &= -3. \end{aligned}

So every solution has the form

x=[105030]+u[210000]+v[101100]+w[201011].x= \begin{bmatrix} 1\\0\\5\\0\\-3\\0 \end{bmatrix} +u \begin{bmatrix} -2\\1\\0\\0\\0\\0 \end{bmatrix} +v \begin{bmatrix} -1\\0\\1\\1\\0\\0 \end{bmatrix} +w \begin{bmatrix} -2\\0\\1\\0\\-1\\1 \end{bmatrix}.

This example illustrates the real purpose of a long reduction: not merely to produce zeros, but to expose the pivot/free-variable pattern from which the whole solution set follows.

How to read an RREF matrix

Once a matrix is in RREF, the main reading questions are:

  • Does every variable column have a pivot?
  • Is there any free variable?
  • Is there a contradiction row?

Worked example

Read structure before you compute

Suppose you arrive at

[103501210000].\begin{bmatrix} 1 & 0 & 3 & 5 \\ 0 & 1 & -2 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix}.

Here columns 1 and 2 are pivot columns, but column 3 is not. That means the third variable is free.

So this system does not have one unique solution. Instead, it has infinitely many solutions, because you may choose the free variable first and then solve for the pivot variables.

Theorem

What a contradiction row means

If row reduction produces a row such as

[0001],\begin{bmatrix} 0 & 0 & 0 & 1 \end{bmatrix},

then the corresponding equation is 0=10 = 1. That is impossible, so the system is inconsistent and has no solution.

Worked example

When a matrix is almost RREF

Sometimes a matrix is very close to RREF, but one pivot column has not yet been cleaned. For example,

[130124001101000013000000]\begin{bmatrix} 1 & 3 & 0 & 1 & 2 & 4 \\ 0 & 0 & 1 & 1 & 0 & -1 \\ 0 & 0 & 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}

is not RREF because the pivot in column 5 has a 2 above it. The single move

R1R12R3R_1\leftarrow R_1-2R_3

gives

[130102001101000013000000].\begin{bmatrix} 1 & 3 & 0 & 1 & 0 & -2 \\ 0 & 0 & 1 & 1 & 0 & -1 \\ 0 & 0 & 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}.

Now the pivot columns are clean, so the matrix is in RREF. The free variables are x2x_2 and x4x_4; with x2=sx_2=s and x4=tx_4=t, the solution is

x=[20103]+s[31000]+t[10110].x= \begin{bmatrix} -2\\0\\-1\\0\\3 \end{bmatrix} +s \begin{bmatrix} -3\\1\\0\\0\\0 \end{bmatrix} +t \begin{bmatrix} -1\\0\\-1\\1\\0 \end{bmatrix}.

Common mistakes

Common mistake

REF is not yet RREF

It is common to stop as soon as everything below each pivot is 0. That may be good enough for back-substitution, but it is not yet RREF. In RREF, each pivot column must have zeros everywhere else as well.

Common mistake

Choosing operations without a target

Do not subtract rows just because “something should happen.” Before each move, state the target clearly:

  • which pivot are you using?
  • which entry are you trying to kill?
  • why is this the best next move?

That habit keeps your work organized and makes sign mistakes easier to catch.

Quick checks

Quick check

When should you swap rows before eliminating?

Think about the first available pivot position. What if the entry there is 0 but a nonzero entry appears lower in the same column?

Solution

Answer

Quick check

Is [0 0 0 | 1] a harmless row?

Translate the row back into an equation before you answer.

Solution

Answer

Quick check

In the longer reduction above, why are x2x_2, x4x_4, and x6x_6 free?

Look at the final RREF C'. Which variable columns contain leading 1s?

Solution

Answer

Exercises

Exercise 1

Start from

[112323580112].\begin{bmatrix} 1 & 1 & 2 & 3 \\ 2 & 3 & 5 & 8 \\ 0 & 1 & 1 & 2 \end{bmatrix}.

What is the most natural first row operation if your goal is to clear the entry below the first pivot?

Solution

Guided solution for exercise 1

Exercise 2

Consider the matrix

[102401130000].\begin{bmatrix} 1 & 0 & 2 & 4 \\ 0 & 1 & -1 & 3 \\ 0 & 0 & 0 & 0 \end{bmatrix}.

Does this represent a system with a unique solution, infinitely many solutions, or no solution?

Solution

Guided solution for exercise 2

Exercise 3

Start from

[130124001101000013000000].\begin{bmatrix} 1 & 3 & 0 & 1 & 2 & 4 \\ 0 & 0 & 1 & 1 & 0 & -1 \\ 0 & 0 & 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}.

Which single row operation turns this matrix into RREF?

Solution

Guided solution for exercise 3

Exercise 4

For the RREF matrix

[1201021001101500001130000000],\begin{bmatrix} 1 & 2 & 0 & 1 & 0 & 2 & 1 \\ 0 & 0 & 1 & -1 & 0 & -1 & 5 \\ 0 & 0 & 0 & 0 & 1 & 1 & -3 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix},

set x2=ux_2=u, x4=vx_4=v, and x6=wx_6=w. Write x1x_1, x3x_3, and x5x_5 in terms of u, v, and w.

Solution

Guided solution for exercise 4

Read this first

This page builds directly on 2.2 Augmented matrices and row operations. If you are still unsure why row operations preserve the solution set, go back to that note first before practicing longer elimination paths.

Section mastery checkpoint

Answer each question correctly to complete this section checkpoint. Correct progress: 0%.

Skills: rref, pivot-columns, row-reduction

In RREF, which statement is always true about pivot columns of a matrix A?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

  • Preview shows which choice label you are about to submit.

Skills: rref, pivot-columns, free-variable

In the RREF coefficient matrix [[1,0,3],[0,1,2]][[1,0,3],[0,1,-2]], which variable is free?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Skills: rref, row-operations, pivot-columns

A matrix has a pivot 1 in row 3, column 5, and the only other nonzero entry in that column is 2 in row 1. Which operation clears the pivot column?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Skills: rref, parametric-solution, free-variable

For the RREF rows x1+2x2+x4+2x6=1x_1+2x_2+x_4+2x_6=1, x3x4x6=5x_3-x_4-x_6=5, and x5+x6=3x_5+x_6=-3, set x2=1x_2=1, x4=0x_4=0, and x6=2x_6=2. Fill in the blank: x_5=____.

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Syntax guidance: Enter one scalar.

Key terms in this unit

Premium learning add-ons

Core notes stay free. Advanced exercises, video explanations, and premium exports are available through paid plans.