Multiple equations with multiple unknowns. Gaussian elimination.
Deep-dive lesson - accessible entry point but dense material. Use worked examples and spaced repetition.
When you have many unknowns and many equations, “solve for x” stops being a single trick and becomes a reusable procedure. Systems of linear equations are where algebra turns into a reliable algorithm: represent the system as Ax = b, then use Gaussian elimination to systematically simplify it until the answers are visible.
A system of linear equations can be written as a matrix equation Ax = b. To solve it, build the augmented matrix [A | b] and apply elementary row operations to reach (reduced) row‑echelon form. Then read off whether the system has a unique solution, infinitely many solutions, or no solution.
A single linear equation like y = mx + b describes a line. Two linear equations in two unknowns describe the intersection of two lines. But real problems often look like:
In all these, you have multiple linear constraints and you want values of the unknowns that satisfy all of them simultaneously.
A system of linear equations is a set of equations where each equation is linear in the unknowns. For unknowns x₁, x₂, …, xₙ, a typical system is:
a₁₁x₁ + a₁₂x₂ + … + a₁ₙxₙ = b₁
a₂₁x₁ + a₂₂x₂ + … + a₂ₙxₙ = b₂
…
aₘ₁x₁ + aₘ₂x₂ + … + aₘₙxₙ = bₘ
Here:
This system is compactly written as:
Ax = b
where:
Using bold for vectors:
x = (x₁, x₂, …, xₙ)ᵀ
b = (b₁, b₂, …, bₘ)ᵀ
A solution is any vector x such that Ax = b.
There are three high-level possibilities:
| Situation | What it means geometrically (in 2D/3D) | What you see algebraically |
|---|---|---|
| Unique solution | lines/planes intersect at exactly one point | one pivot per variable, no contradictions |
| Infinitely many solutions | lines coincide; planes intersect in a line/plane | at least one free variable |
| No solution | parallel inconsistent lines/planes | a contradiction like 0 = 1 |
Instead of writing all equations, we “pack” them into one matrix by appending b as an extra column:
[A | b]
This is called the augmented matrix. It represents the same system, just more conveniently for computations.
For example, the system:
2x + y = 5
x − 3y = −4
becomes:
A = [ [2, 1], [1, −3] ]
b = [5, −4]ᵀ
[A | b] = [ [2, 1 | 5], [1, −3 | −4] ]
The entire point of the next sections is: operate on rows of [A | b] to simplify the system without changing its solution set.
If you take an equation and:
1) swap it with another equation,
2) multiply it by a nonzero number,
3) add a multiple of another equation,
you do not change the set of common solutions. You’re just rewriting the same constraints in an equivalent form.
Gaussian elimination is the process of doing these rewrites systematically until the system is easy to solve.
When working with the augmented matrix [A | b], we treat each row as one equation.
| Row operation | Notation | Meaning in equation form |
|---|---|---|
| Swap two rows | Rᵢ ↔ Rⱼ | reorder equations |
| Scale a row | Rᵢ ← cRᵢ (c ≠ 0) | multiply an equation by nonzero c |
| Replace a row by itself plus a multiple of another | Rᵢ ← Rᵢ + cRⱼ | add c·(equation j) to equation i |
then it satisfies their combination:
So these operations create an equivalent system.
Row operations aim to create zeros below (and sometimes above) a chosen “leading” coefficient.
Key vocabulary:
Two common targets:
1) Row-echelon form (REF)
2) Reduced row-echelon form (RREF) (Gauss–Jordan)
REF is enough to solve by back-substitution; RREF makes solutions easiest to read directly.
Once you reach REF/RREF, you can diagnose:
(There are edge cases with non-square systems, but the pivot/free-variable logic still classifies solution sets correctly.)
Solving a system directly can be messy because variables are entangled across equations. Gaussian elimination creates a simpler, equivalent system where variables are gradually “separated.”
The high-level plan:
1) Put [A | b] into REF (forward elimination)
2) Solve from bottom to top (back-substitution)
Optionally:
3) Continue to RREF (Gauss–Jordan) to read solutions immediately
Suppose we have m equations and n unknowns. The elimination loop conceptually does:
For each column (variable) from left to right:
A practical note: when computing with floating point, people often use partial pivoting (choose the largest magnitude entry as pivot). For difficulty 2, you mainly need the symbolic/hand method: pick a nonzero pivot.
After forward elimination, the last row typically involves the last pivot variable, then you substitute upward.
RREF gives equations of the form:
x₁ = (number) + (coefficients)·(free variables)
which makes parametric solution sets very clear.
If n variables but only r pivots (r < n), then there are n − r free variables. You can choose those freely (parameters), and the pivot variables become determined by them.
Example template in RREF:
[1 0 2 | 3]
[0 1 −1 | 4]
Here x₃ is free.
Equations:
Let x₃ = t. Then:
x = (x₁, x₂, x₃)ᵀ = (3 − 2t, 4 + t, t)ᵀ
This is an infinite set (a line in ℝ³).
If elimination produces:
[0 0 0 | 1]
that corresponds to 0 = 1, so the system is inconsistent.
When every variable is a pivot variable (no free variables) and there is no contradiction row, you get a unique solution.
In RREF for a square n×n system, it looks like:
[I | x]
where I is the identity matrix, and the right side is the unique solution vector.
You already know a matrix as a linear transformation. In Ax = b:
So “solving the system” means: find an input that maps to a particular output.
If you think of A as a function, solving Ax = b is like inverting that function on a particular value b.
Gaussian elimination is the algebraic method that scales beyond what you can visualize.
Gaussian elimination is the foundation under many higher-level tools:
By hand, Gaussian elimination is great for understanding and small systems (2×2, 3×3). For large systems, computers use optimized variants (pivoting, sparse methods) to control round-off and complexity.
Solve the system:
2x + y = 5
x − 3y = −4
Write it as [A | b] and use row operations to reach RREF.
Form the augmented matrix:
[ 2 1 | 5 ]
[ 1 −3 | −4 ]
Swap rows to get a 1 in the top-left pivot position (optional but convenient):
R₁ ↔ R₂
[ 1 −3 | −4 ]
[ 2 1 | 5 ]
Eliminate the entry below the pivot (make the (2,1) entry zero):
R₂ ← R₂ − 2R₁
Compute 2R₁:
2R₁ = [ 2 −6 | −8 ]
Now subtract:
R₂ = [ 2 1 | 5 ] − [ 2 −6 | −8 ] = [ 0 7 | 13 ]
So:
[ 1 −3 | −4 ]
[ 0 7 | 13 ]
Scale the second row to make the pivot 1:
R₂ ← (1/7)R₂
[ 1 −3 | −4 ]
[ 0 1 | 13/7 ]
Eliminate the entry above the pivot to reach RREF:
R₁ ← R₁ + 3R₂
Compute 3R₂:
3R₂ = [ 0 3 | 39/7 ]
Add to R₁:
R₁ = [ 1 −3 | −4 ] + [ 0 3 | 39/7 ] = [ 1 0 | −4 + 39/7 ]
Convert −4 = −28/7:
−28/7 + 39/7 = 11/7
So:
[ 1 0 | 11/7 ]
[ 0 1 | 13/7 ]
Read the solution:
x = 11/7
y = 13/7
Insight: Row operations turned two entangled equations into x = constant and y = constant. In RREF, the left side becomes I, making the unique solution immediate.
Solve:
x + y + z = 2
2x + 2y + 2z = 4
x − y + z = 0
Use Gaussian elimination and express the solution set with a parameter.
Write the augmented matrix:
[ 1 1 1 | 2 ]
[ 2 2 2 | 4 ]
[ 1 −1 1 | 0 ]
Eliminate below the first pivot (in column 1):
R₂ ← R₂ − 2R₁
R₃ ← R₃ − R₁
Compute:
R₂: [2 2 2 | 4] − 2·[1 1 1 | 2] = [0 0 0 | 0]
R₃: [1 −1 1 | 0] − [1 1 1 | 2] = [0 −2 0 | −2]
Matrix becomes:
[ 1 1 1 | 2 ]
[ 0 0 0 | 0 ]
[ 0 −2 0 | −2 ]
Swap rows to keep nonzero rows on top (REF convention):
R₂ ↔ R₃
[ 1 1 1 | 2 ]
[ 0 −2 0 | −2 ]
[ 0 0 0 | 0 ]
Scale row 2 to make the pivot 1:
R₂ ← (−1/2)R₂
[ 1 1 1 | 2 ]
[ 0 1 0 | 1 ]
[ 0 0 0 | 0 ]
Eliminate the y term from row 1:
R₁ ← R₁ − R₂
[ 1 0 1 | 1 ]
[ 0 1 0 | 1 ]
[ 0 0 0 | 0 ]
Interpret the RREF equations:
Row 1: x + z = 1
Row 2: y = 1
Row 3: 0 = 0 (no new information)
Let z be free: set z = t.
Then:
x = 1 − t
y = 1
z = t
So:
x = (x, y, z)ᵀ = (1 − t, 1, t)ᵀ
Insight: The second equation was redundant (a multiple of the first), so there weren’t enough independent constraints to pin down all variables. One free variable ⇒ infinitely many solutions.
Solve (or show no solution):
x + y = 1
2x + 2y = 3
Use elimination on [A | b].
Augmented matrix:
[ 1 1 | 1 ]
[ 2 2 | 3 ]
Eliminate below the pivot:
R₂ ← R₂ − 2R₁
Compute:
[2 2 | 3] − 2·[1 1 | 1] = [0 0 | 1]
So we get:
[ 1 1 | 1 ]
[ 0 0 | 1 ]
Interpret row 2:
0x + 0y = 1
This is 0 = 1, which is impossible.
Conclude:
No solution (the system is inconsistent).
Insight: Elimination doesn’t just find solutions; it also proves impossibility. A row of zeros on the left with a nonzero right side is the unmistakable inconsistency signal.
A system of linear equations can be written compactly as Ax = b.
The augmented matrix [A | b] is a bookkeeping tool that lets you apply row operations to coefficients and constants together.
Elementary row operations (swap, scale by nonzero, row replacement) produce an equivalent system with the same solution set.
Gaussian elimination (forward elimination + back-substitution) converts [A | b] to row-echelon form to make solving systematic.
RREF makes solutions easiest to read: pivot variables are determined; free variables become parameters.
A contradiction row [0 0 … 0 | c] with c ≠ 0 means no solution.
Fewer pivots than variables means infinitely many solutions (at least one free variable).
Forgetting to apply a row operation to the entire augmented row (including the b column).
Treating scaling by 0 as a valid row operation (it is not; it destroys equivalence).
Stopping at REF but mis-reading which variables are free vs pivot variables, leading to an incorrect parameterization.
Arithmetic slips during elimination (especially sign errors) that create fake contradictions or fake free variables.
Solve using Gaussian elimination:
3x − y = 7
6x − 2y = 14
Hint: Notice the second equation is a multiple of the first. What does that imply about pivots/free variables?
Augmented matrix:
[ 3 −1 | 7 ]
[ 6 −2 | 14 ]
Eliminate:
R₂ ← R₂ − 2R₁
[6 −2 | 14] − 2·[3 −1 | 7] = [0 0 | 0]
So the system reduces to one equation: 3x − y = 7.
Let y = t (free).
Then 3x − t = 7 ⇒ x = (7 + t)/3.
Infinitely many solutions: (x, y) = ((7 + t)/3, t).
Solve and classify (unique/infinite/none):
x + 2y − z = 1
2x + 4y − 2z = 2
−x − 2y + z = 0
Hint: After elimination, check whether you get a contradiction row or a free variable. Watch for dependent equations.
Augmented matrix:
[ 1 2 −1 | 1 ]
[ 2 4 −2 | 2 ]
[−1 −2 1 | 0 ]
Eliminate using R₁ as pivot:
R₂ ← R₂ − 2R₁:
[2 4 −2 | 2] − 2·[1 2 −1 | 1] = [0 0 0 | 0]
R₃ ← R₃ + R₁:
[−1 −2 1 | 0] + [1 2 −1 | 1] = [0 0 0 | 1]
Now we have a contradiction row [0 0 0 | 1] ⇒ 0 = 1.
Therefore the system has no solution (inconsistent).
Find the solution set in parametric vector form for:
x + y + z + w = 2
2x + y + 3z + w = 5
Hint: You have 2 equations and 4 unknowns, so expect 2 free variables. Use elimination to express pivot variables in terms of the free ones.
Augmented matrix:
[ 1 1 1 1 | 2 ]
[ 2 1 3 1 | 5 ]
Eliminate below pivot in column 1:
R₂ ← R₂ − 2R₁
R₂ = [2 1 3 1 | 5] − 2·[1 1 1 1 | 2] = [0 −1 1 −1 | 1]
So:
[ 1 1 1 1 | 2 ]
[ 0 −1 1 −1 | 1 ]
Scale row 2:
R₂ ← −R₂:
[ 1 1 1 1 | 2 ]
[ 0 1 −1 1 | −1 ]
Eliminate y from row 1:
R₁ ← R₁ − R₂:
[1 1 1 1 | 2] − [0 1 −1 1 | −1] = [1 0 2 0 | 3]
RREF-like system:
Row 1: x + 2z = 3
Row 2: y − z + w = −1
Let z = s and w = t (free variables).
Then:
x = 3 − 2s
y = −1 + s − t
Parametric vector form:
x = (x, y, z, w)ᵀ
= (3 − 2s, −1 + s − t, s, t)ᵀ
= (3, −1, 0, 0)ᵀ + s(−2, 1, 1, 0)ᵀ + t(0, −1, 0, 1)ᵀ.