Linear Algebra — Topic 06

Row Reduction & Echelon Form
Gaussian Elimination, Step by Step

Every system of linear equations reduces, through a sequence of three simple operations on its augmented matrix, to a form that makes the solution immediately readable. This page walks through every idea, augmented matrices, the three row operations, Row Echelon Form, Reduced Row Echelon Form, pivots, free variables, and back-substitution: with 12 fully worked examples and a quiz.

3Row Operations
12Worked Examples
3Solution Types
10Quiz Questions
Share this page
On This Page
  1. The Augmented Matrix, Writing a System as a Matrix
  2. The Three Elementary Row Operations
  3. Row Echelon Form (REF)
  4. Reduced Row Echelon Form (RREF)
  5. Pivot Positions and Free Variables
  6. The Three Solution Types
  7. Back Substitution
  8. 12 Fully Worked Examples
  9. Common Mistakes
  10. 10-Question Practice Quiz

§ 01The Augmented Matrix

A system of linear equations carries all of its information in its coefficients and constants. The augmented matrix strips away the variable names and stores just those numbers, making systematic manipulation fast and clean.

Consider the system of three equations in three unknowns:

System of equations
2x + 3y − z = 7 −x + y + 2z = 1 3x − 2y + z = 4

We form the augmented matrix [A | b] by writing the coefficients of x, y, z in the first three columns, then a vertical bar, then the right-hand-side constants in the final column:

Augmented matrix [A | b]
23−17
−1121
3−214

Every row of the augmented matrix corresponds to one equation. Every column (except the last) corresponds to one variable. The vertical bar represents the equals signs. The goal of row reduction is to transform this matrix into a form where the solution is obvious by inspection.

Why bother with matrices? Writing the same variables x, y, z over and over in every step wastes time and invites errors. The matrix strips the problem down to its numerical skeleton. The row operations we apply to the matrix correspond exactly to legal operations on the equations — so the solution set never changes.

§ 02The Three Elementary Row Operations

There are exactly three operations we are permitted to perform on the rows of a matrix. Each one corresponds to a legal manipulation of the underlying system of equations and leaves the solution set unchanged.

Operation R1
Row Swap
Interchange two rows: Ri ↔ Rj. This reorders the equations, which clearly doesn't affect the solution.
Operation R2
Scalar Multiplication
Multiply a row by any non-zero scalar k: Ri → k·Ri. Multiplying an equation by a non-zero constant produces an equivalent equation.
Operation R3
Row Addition
Replace a row by itself plus a multiple of another row: Ri → Ri + k·Rj. This is the core of Gaussian elimination — it creates zeros below pivots.
Critical rule: never multiply a row by zero. Multiplying Ri by zero destroys an equation, replacing it with 0 = 0 and discarding information. The scalar in R2 must be strictly non-zero.

In practice, Operation R3 is used constantly. The standard notation for "replace row 2 with row 2 minus 3 times row 1" is written: R₂ → R₂ − 3R₁. This notation appears above each arrow between matrices in the worked examples below.

§ 03Row Echelon Form (REF)

A matrix is in Row Echelon Form when it satisfies three conditions:

REF Condition 1
All-zero rows are at the bottom. Any row consisting entirely of zeros must be below all non-zero rows.
REF Condition 2
Leading entries form a staircase. The first non-zero entry in each row (called the pivot) lies strictly to the right of the pivot in the row above it.
REF Condition 3
All entries below a pivot are zero. Everything below each pivot in its column must be zero. Entries above need not be.

A matrix in REF looks like a staircase descending from top-left to bottom-right. The pivots are the leading (leftmost) non-zero entries in each row and can be any non-zero value: they do not have to be 1.

Example of a matrix in REF (pivots highlighted)
2518
03-42
0075

Notice the staircase pattern: the first non-zero entry in row 2 is one column to the right of the one in row 1, and similarly for row 3. All entries below each teal pivot are zero.

Gaussian Elimination — The Algorithm to Reach REF

Gaussian elimination is the systematic procedure for reducing any augmented matrix to REF:

Step 1
Locate the leftmost non-zero column
This column will contain the first pivot. If needed, swap rows to put a non-zero entry at the top of this column.
Step 2
Eliminate below the pivot
Use R3 operations to create zeros in every entry below the pivot in that column.
Step 3
Cover the pivot row and repeat
Ignore the top row and apply steps 1–2 to the remaining sub-matrix. Repeat until in REF.

§ 04Reduced Row Echelon Form (RREF)

RREF is a stricter version of REF. A matrix is in Reduced Row Echelon Form when it satisfies all three REF conditions plus two additional ones:

RREF Condition 4
Every pivot equals 1. Scale each pivot row to make the leading entry exactly 1 (using R2).
RREF Condition 5
All entries above a pivot are also zero. Use R3 to eliminate entries both below and above each pivot column.

A matrix in RREF is unique, every matrix has exactly one RREF. This makes it ideal: reading the solution directly from the RREF requires no further arithmetic.

The same matrix after reduction to RREF
1003
010−1
0012

From this RREF, the solution is immediate: x = 3, y = −1, z = 2. No algebra required, just read off the right-hand column.

Gauss–Jordan Elimination

The process of reducing all the way to RREF (eliminating both above and below each pivot, then scaling pivots to 1) is called Gauss–Jordan elimination, named after Carl Friedrich Gauss and Wilhelm Jordan. The partial process that stops at REF is called plain Gaussian elimination.

§ 05Pivot Positions and Free Variables

The structure of the RREF tells you everything about the solution of the system. The key vocabulary: pivot columns, non-pivot columns, and free variables.

Pivot Column
A column containing a pivot (leading 1 in RREF). The variable corresponding to a pivot column is called a basic variable (or pivot variable). Its value is determined uniquely, or expressed in terms of free variables.
Non-Pivot (Free) Column
A column with no pivot. The variable corresponding to a non-pivot column is a free variable. It can take any real value. Each free variable generates a dimension of the solution space.

Counting Free Variables

If a system has n variables and the RREF has r pivot positions (one per non-zero row), then:

Number of free variables
Number of free variables = n − r

where n is the total number of variables and r is the rank (number of pivot positions).

If there are zero free variables, the system has exactly one solution. If there is at least one free variable, the system has infinitely many solutions (a line, plane, or higher-dimensional solution set). If the system is inconsistent, there is no solution regardless of free variables.

RREF with one free variable (x₃ is free, shown in gold)
1025
01−31
0000

Here columns 1 and 2 are pivot columns. Column 3 has no pivot: x₃ is a free variable. Reading: x₁ = 5 − 2x₃ and x₂ = 1 + 3x₃, with x₃ ∈ ℝ.

§ 06The Three Possible Solution Types

After reducing to REF or RREF, a linear system falls into exactly one of three categories. You can always diagnose which case you are in by inspecting the final matrix.

TypeHow to Recognise It in REF/RREFNumber of Solutions
Unique solution No zero rows, no free variables — each column has a pivot. The system is consistent and determined. Exactly one
Infinitely many solutions No contradiction row [0 0 … 0 | c ≠ 0], but at least one non-pivot column exists. Each free variable generates a family of solutions. Infinitely many (parameterised)
No solution (inconsistent) A row of the form [0 0 … 0 | c] where c ≠ 0 appears. This encodes the impossible equation 0 = c. Zero
The inconsistency test. Always check for a row of the form [0 0 … 0 | c] with c ≠ 0 before anything else. If you find one, stop — the system is inconsistent and has no solution, regardless of how many free variables appear.

§ 07Back Substitution

When you stop at REF rather than going all the way to RREF, you recover the solution by back substitution: you read the last (simplest) equation first and substitute upwards.

Suppose your REF is:

12314
04513
0024

Back substitution proceeds:

Back SubReading the REF above
Row 3

2z = 4 → z = 2.

Row 2

4y + 5z = 13 → 4y + 10 = 13 → 4y = 3 → y = 3/4.

Row 1

x + 2y + 3z = 14 → x + 3/2 + 6 = 14 → x = 14 − 7.5 = 6.5.

Solution
x = 13/2,   y = 3/4,   z = 2

Back substitution is faster than completing to RREF when you only need the numerical answer and aren't working symbolically. RREF is preferred when free variables are involved, because it makes the parameterised solution immediately visible.

§ 0812 Fully Worked Examples

Example 012×2 system — unique solution

System: x + 2y = 5,   3x − y = 1.

Augment
125
3−11
R₂→R₂−3R₁
125
0−7−14

This is REF. Now scale R₂: R₂ → (−1/7)R₂.

Eliminate above

R₁ → R₁ − 2R₂: row 1 becomes [1, 0 | 1].

101
012
Solution
x = 1,   y = 2
Example 023×3 system — unique solution, full Gauss–Jordan

System: x + y + z = 6,   2x + y − z = 1,   x − y + 2z = 5.

Augment
1116
21−11
1−125
R₂→R₂−2R₁, R₃→R₃−R₁
1116
0−1−3−11
0−21−1
R₃→R₃−2R₂
1116
0−1−3−11
00721

REF achieved. R₃ → (1/7)R₃ → z = 3. R₂ → (−1)R₂ → y + 3z = 11 → y = 2. R₁ → R₁ − R₂ − R₃ → x = 1.

Solution
x = 1,   y = 2,   z = 3
Example 03Inconsistent system — no solution

System: x + y = 3,   2x + 2y = 9.

Augment & Reduce
113
229
R₂→R₂−2R₁
113
003

Row 2 reads 0·x + 0·y = 3, i.e. 0 = 3. Contradiction.

Conclusion
Inconsistent — no solution. The two lines are parallel.
Example 04Infinitely many solutions — one free variable

System: x + 2y + 3z = 9,   2x − y + z = 4,   3x + y + 4z = 13.

Row Reduce

After R₂ → R₂ − 2R₁ and R₃ → R₃ − 3R₁:

1239
0−5−5−14
0−5−5−14

R₃ → R₃ − R₂ gives a zero row. Scale R₂ by −1/5:

1239
01114/5
0000
Free variable

Column 3 has no pivot → z is free, z = t. From row 2: y = 14/5 − t. From row 1: x = 9 − 2(14/5 − t) − 3t = 9 − 28/5 + 2t − 3t = 17/5 − t.

General Solution
x = 17/5 − t,   y = 14/5 − t,   z = t,   t ∈ ℝ
Example 05Row swap required — zero in pivot position

System: 0·x + 2y = 4,   3x + y = 5.

Augment
024
315

Column 1 of row 1 is zero. We cannot use it as a pivot. Swap: R₁ ↔ R₂.

After R₁↔R₂
315
024

Now in REF. Scale: R₁ → (1/3)R₁, R₂ → (1/2)R₂. Then R₁ → R₁ − (1/3)R₂.

Solution
x = 1,   y = 2
Example 064×3 system — underdetermined, two free variables

System: x₁ + x₂ + x₃ = 4,   2x₁ + x₂ + 3x₃ = 7,   x₁ + 2x₂ − x₃ = 5,   3x₁ + 2x₂ + 4x₃ = 11.

Row Reduce

After full reduction the RREF is:

1023
01−11
0000
0000

Two pivot columns (x₁, x₂); one free variable (x₃ = t).

General Solution
x₁ = 3 − 2t,   x₂ = 1 + t,   x₃ = t,   t ∈ ℝ
Example 07Homogeneous system — always consistent

A homogeneous system has the form Ax = 0 (all right-hand sides are zero). It always has at least the trivial solution x = 0. Non-trivial solutions exist exactly when there are free variables.

System: x − 2y + z = 0,   2x + y − z = 0.

Augment & Reduce
1−210
21−10
R₂→R₂−2R₁
1−210
05−30

2 pivots, 3 unknowns → 1 free variable (z = t). Row 2: y = 3t/5. Row 1: x = 2(3t/5) − t = t/5.

Non-trivial Solution
x = t/5,   y = 3t/5,   z = t   (or equivalently: x = 1, y = 3, z = 5 up to scaling)
Example 08Using RREF to find the inverse of a 2×2 matrix

Row reduction on [A | I] → [I | A⁻¹] lets us compute inverses. Find A⁻¹ where A = [[2, 1], [5, 3]].

Set up [A|I]
2110
5301
R₂→2R₂−5R₁
2110
01−52

R₁→R₁−R₂: [2, 0 | 6, −2]. R₁→(1/2)R₁: [1, 0 | 3, −1].

Inverse
A−1 = [[3, −1], [−5, 2]]

Verify: AA⁻¹ = [[2·3+1·(−5), 2·(−1)+1·2], [5·3+3·(−5), 5·(−1)+3·2]] = [[1,0],[0,1]] ✓

Example 09Identify REF vs RREF

Determine whether each matrix is in REF, RREF, both, or neither.

(a)
130
025
001
(b)
100
010
001
(c)
210
013
000
Answers

(a) REF only. Pivots are 1, 2, 1 (staircase ✓, zeros below ✓), but the pivot in row 2 is 2 (not 1) and there's a non-zero entry above the third pivot. Fails RREF conditions 4 and 5.

(b) RREF (and hence also REF). All pivots = 1, staircase pattern, zeros everywhere else in pivot columns.

(c) Neither. The first pivot is 2 (not 1), so it's not RREF. But also: the entry above the second pivot in row 1 is 1, which is non-zero: however that alone doesn't disqualify REF. The real issue is the pivot in row 1 is 2, not in RREF; and there's no non-zero below it (zeros below is fine), so it is actually REF. Answer: (c) is REF but not RREF because the pivot in row 1 is 2 ≠ 1.

Example 10System with a parameter — when is it consistent?

System: x + 2y = 3,   2x + 4y = k. For what value(s) of k does this system have a solution?

Row Reduce
123
24k
R₂→R₂−2R₁
123
00k−6

Row 2 reads 0 = k − 6. This is only consistent if k − 6 = 0.

Conclusion
Consistent only when k = 6. When k = 6, infinitely many solutions: y = t, x = 3 − 2t, t ∈ ℝ.
Example 11RREF with two free variables — solution as a span

A system of 2 equations in 4 unknowns has been reduced to the RREF below. Write the general solution.

120−13
0014−2
Identify

Pivot columns: 1 and 3 (variables x₁ and x₃). Free columns: 2 and 4 (variables x₂ = s, x₄ = t).

Parametrise

Row 1: x₁ + 2s − t = 3 → x₁ = 3 − 2s + t.

Row 2: x₃ + 4t = −2 → x₃ = −2 − 4t.

General Solution
(x₁, x₂, x₃, x₄) = (3, 0, −2, 0) + s(−2, 1, 0, 0) + t(1, 0, −4, 1),   s,t ∈ ℝ

This is a 2-dimensional plane (affine subspace) in ℝ⁴.

Example 123×3 — full Gauss–Jordan step-by-step

System: 2x − y + z = 8,   −3x + y − 2z = −11,   −2x + y + 2z = −3.

Augment
2−118
−31−2−11
−212−3
R₁→(1/2)R₁
1−1/21/24
−31−2−11
−212−3
R₂→R₂+3R₁, R₃→R₃+2R₁
1−1/21/24
0−1/2−1/21
0035
Scale & eliminate up

R₂ → −2R₂: [0, 1, 1 | −2]. R₃ → (1/3)R₃: [0, 0, 1 | 5/3].

R₂ → R₂ − R₃: [0, 1, 0 | −2 − 5/3 = −11/3]. R₁ → R₁ + (1/2)R₂ − (1/2)R₃.

x = 4 + (1/2)(−11/3) − (1/2)(5/3) = 4 − 11/6 − 5/6 = 4 − 16/6 = 4 − 8/3 = 4/3.

Solution
x = 4/3,   y = −11/3,   z = 5/3

§ 09Common Mistakes

Mistake 1 — Applying a row operation to the wrong row. When you write R₂ → R₂ − 3R₁, you are changing R₂, not R₁. R₁ stays exactly as it was. A common error is accidentally modifying the row you are using as the source.
Mistake 2 — Forgetting to carry the augmented column. Every row operation must be applied to the entire row, including the bar column on the right-hand side. Omitting the constants is the most frequent computational error in row reduction.
Mistake 3 — Declaring a solution before checking for inconsistency. Always scan for a row [0 0 … 0 | c] with c ≠ 0 before writing down any solution. Students sometimes look only at the "nice" rows and miss a contradiction in a later row.
Mistake 4 — Treating a non-pivot column as if it has a unique value. If column j has no pivot, x_j is free — it can be anything. You cannot set it equal to zero unless the system forces it. The general solution must parametrise over all free variables.
Good habit — label every row operation clearly. Write the operation (e.g. R₃ → R₃ − 2R₁) above the arrow between matrices. This makes your work checkable, and forces you to think explicitly about which row you're modifying and which you're using as source.

§ 10Practice Quiz

Test your understanding of row reduction, echelon forms, pivot positions, and solution types. Immediate feedback on every question.

Row Reduction & Echelon Form

10 Questions

Cookie Settings