LINEAR ALGEBRA • SYSTEMS OF LINEAR EQUATIONS & MATRICES

Gaussian Elimination — Solving Systems by Gaussian Elimination

A step-by-step method to solve any system of equations using row operations on matrices.

Historical Context & Motivation

People have been solving systems of equations for thousands of years. Whenever you have two or more unknowns and multiple relationships between them, you need a reliable method to find the answer. Gaussian elimination is one of the oldest and most powerful techniques for doing exactly that. It works by systematically simplifying a system of equations until the answer becomes obvious.

Imagine you're running a bake sale and you know the total cost of different combinations of cookies and brownies. How do you figure out the price of each item? That's exactly the kind of problem Gaussian elimination was built to solve — and it can handle systems with dozens or even thousands of unknowns!

~200 BCE
Ancient Chinese Origins
The Chinese mathematical text The Nine Chapters on the Mathematical Art described a method of solving systems of equations by arranging numbers in a grid and performing operations on rows — the earliest known version of Gaussian elimination.
1810
Carl Friedrich Gauss
The German mathematician Carl Friedrich Gauss used a systematic row-reduction method to solve systems of six equations while studying asteroid orbits. The technique became widely known by his name.
1888
Wilhelm Jordan's Refinement
German geodesist Wilhelm Jordan extended Gauss's method by also eliminating entries above each pivot — not just below — so that the matrix is reduced all the way to the identity form without any back substitution. This upward elimination step is what distinguishes Gauss-Jordan elimination from basic Gaussian elimination and produces reduced row echelon form (RREF) directly.
1950s
Computers Embrace the Method
As digital computers became available, Gaussian elimination became one of the first algorithms programmed for solving large-scale scientific and engineering problems. It remains a core algorithm today.

The central question this method answers is: Given a system of linear equations, how can we find the values of all the unknowns in an organized, step-by-step way? Instead of guessing or trying every possibility, Gaussian elimination gives you a clear recipe to follow every time.

Core Principles & Definitions

Before you can use Gaussian elimination, you need to understand a few key ideas. The method works by rewriting a system of equations as a matrix (a rectangular grid of numbers) and then performing simple operations on its rows until the solution appears.

1

Augmented Matrix

A compact way to write a system of equations. You place all the coefficients (the numbers in front of the variables) and the constants (the numbers after the equals sign) into a grid, separated by a vertical line.
2

Row Operations

Three legal moves you can perform on any row: (1) swap two rows, (2) multiply a row by a nonzero number, or (3) add a multiple of one row to another row. These never change the solution.
3

Row Echelon Form (REF)

The goal of Gaussian elimination. In REF, every row's leading number (called a pivot) is to the right of the pivot above it, and all entries below each pivot are zero. It looks like a staircase.
4

Back Substitution

Once the matrix is in REF, you solve for variables starting from the bottom row and working upward. Each row gives you one variable's value, which you plug into the rows above.
5

Pivot Position

The first nonzero entry in each row after elimination. Pivots are the "stepping stones" that form the staircase pattern. Ideally, each pivot equals 1.
KEY TAKEAWAY
Think of Gaussian elimination like organizing a messy room. You have a pile of information (equations), and you use three simple moves (row operations) to sort everything into neat stacks. Once it's tidy (row echelon form), finding what you need (the solution) is easy — you just read it from the bottom up.

Visual Explanation — From Equations to Echelon Form

The diagram below shows the full journey of Gaussian elimination. You start with a system of three equations, translate them into an augmented matrix, perform row operations to create zeros below the diagonal, and arrive at row echelon form. From there, back substitution reveals each variable's value.

The flowchart above traces a 3×3 system from its original form through the augmented matrix, two elimination steps that create zeros below the diagonal, and finally back substitution to find x = 4, y = −2, and z = 3.

Notice the staircase pattern in the row echelon form: the leading nonzero number in each row shifts one column to the right. Every entry below a pivot is zero. This structure is what makes back substitution possible — you can read the last variable directly from the bottom row and work your way up.

Mathematical Framework — Row Operations & Notation

Gaussian elimination relies on three elementary row operations. These are the only moves you're allowed to make, and the beautiful thing is that none of them change the solution to the system. They're like rearranging the terms of a puzzle without losing any pieces.

ROW SWAP
Rᵢ ↔ Rⱼ
Swap row i and row j. This is used when a pivot position contains a zero and you need a nonzero number there.
ROW SCALING
kRᵢ → Rᵢ (k ≠ 0)
Multiply every entry in row i by a nonzero constant k. This is useful for turning a pivot into 1.
ROW REPLACEMENT
Rᵢ + kRⱼ → Rᵢ
Replace row i with the sum of row i and k times row j. This is the main operation used to create zeros below pivots.

The overall algorithm has two phases. In the forward elimination phase, you work from top to bottom, using row replacement to create zeros below each pivot. This produces row echelon form. In the back substitution phase, you start at the bottom row and solve for one variable at a time, substituting each value into the equations above.

⚠️ Important Rule
You can never multiply a row by zero — that would destroy information and change the solution. Also, when using row replacement, you always add a multiple of one row to another row. The row you're using as a tool (the pivot row) stays the same.

The Staircase — Understanding Row Echelon Form

The goal of forward elimination is to transform the augmented matrix into row echelon form (REF). In REF, the matrix has a staircase shape: each row's first nonzero entry (the pivot) is further to the right than the pivot in the row above. All entries below each pivot are zero. The diagram below compares a matrix before and after elimination to highlight this pattern.

The upper half compares a raw matrix with its row echelon form. The yellow highlighted boxes mark the pivots. The lower half shows the general anatomy of REF: zeros fill the region below and to the left of each pivot, creating the characteristic staircase.

There are three things to check when deciding if a matrix is in row echelon form. First, all zero rows (rows where every entry is zero) must be at the bottom. Second, each pivot must be to the right of the pivot in the row above. Third, every entry directly below a pivot must be zero. If all three conditions are met, you're ready for back substitution.

💡 REF vs. RREF
You might also hear about reduced row echelon form (RREF). In RREF, each pivot is 1 and the entries above each pivot are also zero. RREF gives you the solution directly without needing back substitution, but it takes more steps to reach.

Worked Example — A 3×3 System

Let's solve this system of three equations step by step using Gaussian elimination:

SYSTEM TO SOLVE
x + 2y − z = 3 2x + 5y + 2z = 11 3x + 9y + 4z = 22
Three equations with three unknowns: x, y, and z.
Gaussian Elimination — Full Solution
1
Step 1 — Write the Augmented MatrixTake the coefficients and constants from each equation and arrange them in a matrix. The vertical bar separates the left side from the right side of the equations.
[ 1 2 −1 | 3 ] [ 2 5 2 | 11 ] [ 3 9 4 | 22 ]
2
Step 2 — Eliminate x from Row 2 (R₂ − 2R₁ → R₂)The entry below the first pivot (the 2 in Row 2, Column 1) needs to become zero. Multiply Row 1 by 2 and subtract it from Row 2. Row 2 becomes: [2−2(1), 5−2(2), 2−2(−1), 11−2(3)] = [0, 1, 4, 5].
[ 1 2 −1 | 3 ] [ 0 1 4 | 5 ] [ 3 9 4 | 22 ]
3
Step 3 — Eliminate x from Row 3 (R₃ − 3R₁ → R₃)The entry in Row 3, Column 1 is 3. Multiply Row 1 by 3 and subtract from Row 3. Computing each entry: 3−3(1)=0, 9−3(2)=3, 4−3(−1)=4+3=7, 22−3(3)=13. Row 3 becomes: [0, 3, 7, 13].
[ 1 2 −1 | 3 ] [ 0 1 4 | 5 ] [ 0 3 7 | 13 ]
4
Step 4 — Eliminate y from Row 3 (R₃ − 3R₂ → R₃)Now focus on the second pivot (the 1 in Row 2, Column 2). The entry below it in Row 3 is 3. Multiply Row 2 by 3 and subtract from Row 3. Row 3 becomes: [0−0, 3−3, 7−12, 13−15] = [0, 0, −5, −2].
[ 1 2 −1 | 3 ] [ 0 1 4 | 5 ] [ 0 0 −5 | −2 ] ← Row Echelon Form!
5
Step 5 — Back Substitution (Bottom to Top)From Row 3: −5z = −2, so z = 2/5. From Row 2: y + 4(2/5) = 5, so y = 5 − 8/5 = 17/5. From Row 1: x + 2(17/5) − (2/5) = 3, so x = 3 − 34/5 + 2/5 = 15/5 − 32/5 = −17/5.
x = −17/5, y = 17/5, z = 2/5
6
Step 6 — Verify the SolutionPlug the values back into all three original equations to confirm. Equation 1: (−17/5) + 2(17/5) − (2/5) = (−17 + 34 − 2)/5 = 15/5 = 3 ✓. Equation 2: 2(−17/5) + 5(17/5) + 2(2/5) = (−34 + 85 + 4)/5 = 55/5 = 11 ✓. Equation 3: 3(−17/5) + 9(17/5) + 4(2/5) = (−51 + 153 + 8)/5 = 110/5 = 22 ✓.
All three equations check out — the solution is correct!

Strengths & Limitations of Gaussian Elimination

Gaussian elimination is incredibly versatile, but like any tool, it has situations where it shines and situations where it can be tricky. Understanding these will help you know when to use it and what to watch out for.

Comparing the strengths and limitations of Gaussian elimination
AspectStrengthsLimitations
GeneralityWorks for any size system — 2 equations, 10 equations, or 1,000 equations.For very large systems (millions of equations), it can be slow compared to iterative methods.
ReliabilityAlways produces an answer: one solution, no solution, or infinitely many solutions.Rounding errors can build up with decimals. Using fractions helps avoid this.
SystematicFollow the same steps every time — no guessing or creativity required.Can be tedious by hand for large systems; best done on a computer.
Special CasesNaturally reveals when a system has no solution (inconsistent) or infinite solutions (dependent).A row of all zeros on the left with a nonzero constant on the right signals no solution — easy to miss.
KEY TAKEAWAY
Think of Gaussian elimination as a universal Swiss Army knife for solving systems of equations. It's not always the fastest tool for every job, but it always works and you can always rely on it. For everyday problems and learning, it's the most important technique to master before moving on to more specialized methods.

Connections to Advanced Topics

Gaussian elimination is a gateway to many powerful ideas in linear algebra. Once you're comfortable with it, you'll find that the same row operations unlock doors to understanding matrix inverses, determinants, and more.

How Gaussian elimination connects to advanced linear algebra
Gaussian EliminationAdvanced Extension
Finds the solution to a system Ax = bMatrix Inverse — Lets you solve many systems with the same A by computing A⁻¹ (a more advanced technique studied in higher-level courses)
Reduces a matrix to row echelon formDeterminants — A special number computed from a square matrix; the product of the pivots (with sign adjustments) gives the determinant of A (explored in advanced algebra)
Identifies pivot and free variablesRank & Solution Structure — The number of pivots tells you the rank (how many independent equations you have); free variables (non-pivot variables) appear when there are infinitely many solutions (a college-level topic)
Handles 3×3 or 4×4 systems by handLU Decomposition — A computer-efficient version of elimination that factors A into a lower triangular matrix (L) and an upper triangular matrix (U), widely used in engineering and science software

As you continue studying math, you'll discover that nearly every concept in linear algebra either uses or builds on the ideas from Gaussian elimination. Mastering it now gives you a rock-solid foundation for everything that comes next, from studying how matrices stretch and rotate space (a topic that leads to eigenvalues in advanced courses) to understanding collections of vectors called vector spaces (studied in college-level linear algebra). Keep practicing — the row operations will become second nature.

Practice Problems

PROBLEM 1CONCEPTUAL
What are the three elementary row operations, and why is it important that they don't change the solution of the system?
PROBLEM 2BASIC CALCULATION
Solve the following 2×2 system using Gaussian elimination: x + 3y = 7 and 2x + 5y = 11.
PROBLEM 3INTERMEDIATE
Solve by Gaussian elimination: 2x + 4y − 2z = 2, 4x + 9y − 3z = 8, −2x − 3y + 7z = 10.
PROBLEM 4APPLIED
A movie theater sells child tickets for $c, adult tickets for $a, and senior tickets for $s. On Friday, they sold 3 child + 5 adult + 2 senior = $89. On Saturday, 4 child + 2 adult + 3 senior = $62. On Sunday, 1 child + 6 adult + 4 senior = $99. Set up and solve the system using Gaussian elimination.
PROBLEM 5CRITICAL THINKING
Consider the system: x + 2y + 3z = 6, 2x + 4y + 6z = 12, x + y + z = 3. Apply Gaussian elimination. What happens, and what does the result tell you about the number of solutions?

Lesson Summary

Gaussian elimination is a systematic method for solving systems of linear equations. You begin by writing the system as an augmented matrix, then use three elementary row operations — row swapping, row scaling, and row replacement — to transform the matrix into row echelon form (REF). In REF, the pivots form a staircase pattern with zeros below each one.

Once in REF, you use back substitution to solve for each variable, starting from the bottom row and working upward. The method works for systems of any size and also reveals special cases: a row like [0 0 0 | 5] means no solution exists, while a row of all zeros indicates infinitely many solutions with free variables. Mastering Gaussian elimination is essential for advancing into topics like matrix inverses, determinants, and the broader world of linear algebra.

Varsity Tutors • Linear Algebra • Gaussian Elimination — Solving Systems by Gaussian Elimination