Linear Algebra — Topic 05

Systems of Linear Equations
The Core Problem of Linear Algebra

Every question in linear algebra ultimately asks: does this system Ax = b have a solution, and if so, what is it? This page builds the complete picture, from what a linear equation is, through the three solution types, to every practical method for solving them, with full geometric insight in 2D and 3D and 12 worked examples.

3Solution Types
4Solving Methods
12Worked Examples
10Quiz Questions
Share this page
On This Page
  1. What Is a Linear Equation?
  2. Writing a System in Matrix Form Ax = b
  3. The Three Solution Types
  4. Geometric Interpretation in 2D and 3D
  5. Method 1, Substitution
  6. Method 2: Elimination (by Hand)
  7. Method 3, Gaussian Elimination (Matrix Method)
  8. Method 4, Cramer's Rule
  9. 12 Fully Worked Examples
  10. Common Mistakes
  11. 10-Question Practice Quiz

§ 01What Is a Linear Equation?

A linear equation is one in which every variable appears to exactly the first power, with no products of variables, no exponents other than 1, and no trigonometric, exponential, or logarithmic functions of the variables.

Linear
2x + 3y = 7 Both x and y appear to the first power. The graph is a straight line.
Linear
x − 4y + 2z = 0 Three variables, all to the first power. The graph is a plane in 3D.
Not Linear
x² + y = 5 x is squared — this is a parabola, not a line.
Not Linear
xy = 3 x and y are multiplied together — this is a hyperbola.

A system of linear equations is a collection of two or more linear equations sharing the same set of variables. The variables are unknowns we are trying to find. A solution to the system is a list of values, one for each variable, that satisfies every equation simultaneously.

A system of m equations in n unknowns
a11x1 + a12x2 + ··· + a1nxn = b1 a21x1 + a22x2 + ··· + a2nxn = b2 am1x1 + am2x2 + ··· + amnxn = bm

Here aij are the coefficients (known constants), xj are the unknowns, and bi are the right-hand-side constants.

When all the bi are zero, the system is called homogeneous. When at least one bi is non-zero, it is non-homogeneous. Every homogeneous system has at least the trivial solution x₁ = x₂ = ··· = xₙ = 0.

§ 02Writing a System in Matrix Form Ax = b

Any system of linear equations can be written compactly as a single matrix equation Ax = b, where A is the coefficient matrix, x is the column vector of unknowns, and b is the column vector of constants.

Take the system: 2x − y + 3z = 10,   x + 4y − z = 5,   −3x + 2y + z = −2.

Matrix form Ax = b
2−13
14−1
−321
·
x
y
z
=
10
5
−2

The coefficient matrix A is m×n (m rows, n columns). The unknown vector x is n×1. The constants vector b is m×1. Matrix multiplication Ax produces exactly the left-hand sides of all m equations simultaneously.

The Augmented Matrix

For computation, we append b as an extra column to A, separated by a vertical bar, forming the augmented matrix [A | b]. This single object contains all the information in the system and is what we operate on during row reduction.

Augmented matrix [A | b] for the system above
2−1310
14−15
−321−2
Why matrix form matters. Writing the system as Ax = b opens up every tool of linear algebra: row reduction, matrix inverses, determinants, eigenvalues. It also makes it obvious whether a solution exists — the system is consistent if and only if b lies in the column space of A.

§ 03The Three Solution Types

Every system of linear equations falls into exactly one of three categories. There is no fourth option.

TypeDescriptionTerminologyRow Reduction Signature
Unique solution Exactly one set of values satisfies all equations. Consistent & determined Every column of A has a pivot; no zero-row contradiction.
Infinitely many solutions A whole family of solutions (a line, plane, etc.) satisfies the system. Consistent & underdetermined At least one non-pivot column (free variable); no contradiction row.
No solution No set of values satisfies all equations simultaneously. Inconsistent A row of the form [0 0 ··· 0 | c] with c ≠ 0 appears.
The only check you need: look for a contradiction row first. Before classifying a solution, always scan the row-reduced matrix for a row [0 0 ··· 0 | c] with c ≠ 0. If one exists, the system is inconsistent — full stop. Otherwise, count free variables: zero free variables means a unique solution; one or more free variables means infinitely many.

Consistent and Inconsistent

A system is consistent if it has at least one solution (either exactly one or infinitely many). It is inconsistent if it has no solution. This single binary distinction is often the first question asked about any system.

Overdetermined and Underdetermined

A system with more equations than unknowns (m > n) is overdetermined. It is usually (but not always) inconsistent. A system with fewer equations than unknowns (m < n) is underdetermined. If it is consistent, it automatically has infinitely many solutions because there will always be at least one free variable.

§ 04Geometric Interpretation in 2D and 3D

Linear algebra has a beautiful geometric face. Every linear equation in n variables describes a geometric object in ℝⁿ, and the solution of a system is the intersection of those objects.

Two Equations in Two Unknowns — Lines in ℝ²

Each equation ax + by = c describes a straight line in the xy-plane. Solving the system means finding all points (x, y) that lie on both lines simultaneously.

Case 1 — Unique solution
(x₀,y₀)
Two distinct lines cross at exactly one point. One unique solution.
Case 2 — Infinitely many
same line
Two coincident lines (same equation scaled). Every point on the line is a solution.
Case 3 — No solution
parallel no crossing
Two parallel lines never meet. The system is inconsistent — no solution.

Three Equations in Three Unknowns — Planes in ℝ³

Each equation ax + by + cz = d describes a flat plane in three-dimensional space. Three planes can intersect in a variety of ways:

Unique solution
Three planes meet at a single point. Like the corner of a room where three walls meet — exactly one point satisfies all three equations.
Infinitely many — a line
Three planes share a common line. Two of the planes are consistent with the third but leave one free variable — the solution is parameterised by a line.
Infinitely many — a plane
All three planes are the same plane (or all contain a common plane). Two free variables; the solution is an entire plane.
No solution
The planes have no common intersection. Could be parallel planes, a "triangular prism" arrangement, or two planes intersecting in a line parallel to the third.
The geometric viewpoint is powerful. When you stare at an augmented matrix, you are really asking: "in what way do these hyperplanes intersect?" Understanding this geometry prevents mechanical errors — you know in advance roughly what kind of answer to expect.

§ 05Method 1 — Substitution

Substitution is the most elementary solving technique, best suited to small systems (2×2 or 3×3) where one variable is easy to isolate.

Step 1
Isolate one variable
Choose any equation and solve it for one variable in terms of the others. Choose the simplest isolation — avoid fractions where possible.
Step 2
Substitute into the other equations
Replace every occurrence of the isolated variable in all other equations with the expression found in Step 1. This reduces the system by one variable and one equation.
Step 3
Solve and back-substitute
Solve the reduced system, then substitute back to find the remaining variables. Always verify by plugging the solution into every original equation.
When to use substitution. Substitution shines when a variable already has coefficient 1 or −1 in some equation (isolating it produces no fractions). For larger systems or systems with no clean coefficients, Gaussian elimination on the augmented matrix is faster and less error-prone.

§ 06Method 2 — Elimination (by Hand)

Elimination (also called addition–elimination or the linear combination method) works by multiplying equations by constants and adding them together to cancel a variable.

Step 1
Choose a variable to eliminate
Pick one variable and a pair of equations. Multiply one or both equations so that the chosen variable has equal and opposite coefficients.
Step 2
Add to cancel
Add the two modified equations together. The target variable vanishes, leaving an equation in the remaining variables.
Step 3
Repeat and solve
Use different equation pairs to eliminate the same variable from all other equations, then solve the resulting smaller system.

Elimination by hand is equivalent to performing row operations on the augmented matrix: the two methods are identical in mathematics, just different in notation. For systems of 4 or more equations, the matrix version (Gaussian elimination) is strongly preferred because it is less prone to bookkeeping errors.

§ 07Method 3 — Gaussian Elimination (Matrix Method)

Gaussian elimination is the standard algorithmic method for solving any linear system. It works by transforming the augmented matrix [A | b] through row operations into Row Echelon Form (REF) or Reduced Row Echelon Form (RREF), from which the solution is directly readable. For a full treatment of the algorithm, see the Row Reduction and Echelon Form page.

The algorithm in four lines

1. Write the augmented matrix [A | b].

2. Apply row operations (swap, scale, add) to reach REF.

3. Check for a contradiction row [0 0 ··· 0 | c ≠ 0] → inconsistent if found.

4. Continue to RREF (or use back-substitution from REF) to read off the solution. Free variables parameterise the solution if any non-pivot columns exist.

Using the Matrix Inverse

For a square system (m = n), if the coefficient matrix A is invertible (det A ≠ 0), the unique solution is given directly by:

Solution via matrix inverse
x = A−1b

This is exact but computationally expensive for large systems. In practice, row reduction is preferred because computing A⁻¹ requires roughly three times as much work as solving Ax = b directly.

§ 08Method 4 — Cramer's Rule

Cramer's Rule gives an explicit formula for each variable in a square, non-singular (invertible) system. It expresses each unknown as a ratio of two determinants.

Cramer's Rule for Ax = b, det(A) ≠ 0
xj = det(Aj) / det(A)

where Aj is the matrix formed by replacing the j-th column of A with the vector b.

Cramer's Rule: beautiful but impractical for large systems. For a 2×2 or 3×3 system, Cramer's Rule is quick and elegant. For an n×n system with large n, computing n+1 determinants is far more expensive than Gaussian elimination. Use Cramer's Rule for small, symbolic problems and as a theoretical tool — not for numerical computation.

§ 0912 Fully Worked Examples

Example 012×2 — substitution, unique solution

System: y = 3x − 1  and  2x + y = 9.

Substitute

y is already isolated. Substitute y = 3x − 1 into equation 2: 2x + (3x − 1) = 9 → 5x = 10 → x = 2.

Back-sub

y = 3(2) − 1 = 5.

Verify

Eq 1: 5 = 3(2) − 1 = 5 ✓. Eq 2: 2(2) + 5 = 9 ✓.

Solution
x = 2,   y = 5
Example 022×2 — elimination, unique solution

System: 3x + 2y = 12  and  5x − 2y = 4.

Eliminate y

The y-coefficients are already +2 and −2. Adding the two equations: (3x + 2y) + (5x − 2y) = 12 + 4 → 8x = 16 → x = 2.

Find y

Substitute into equation 1: 3(2) + 2y = 12 → 2y = 6 → y = 3.

Solution
x = 2,   y = 3

Geometric meaning: the two lines cross at the point (2, 3).

Example 032×2 — inconsistent (parallel lines)

System: 2x + 4y = 6  and  x + 2y = 5.

Row reduce
246
125
R₁↔R₂, then R₂→R₂−2R₁
125
00−4

Row 2 reads 0 = −4. Contradiction.

Conclusion
Inconsistent — no solution. The lines are parallel (same slope, different intercepts).
Example 042×2 — infinitely many solutions (coincident lines)

System: 4x − 6y = 10  and  −2x + 3y = −5.

Observe

Multiply equation 2 by −2: 4x − 6y = 10, which is identical to equation 1. The two equations are the same line.

Row reduce
2−35
000

After scaling R₁ → (1/2)R₁: x − (3/2)y = 5/2. y is free (y = t).

General Solution
x = 5/2 + (3/2)t,   y = t,   t ∈ ℝ
Example 053×3 — Gaussian elimination, unique solution

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

Augment
1116
2−113
12−12
R₂→R₂−2R₁, R₃→R₃−R₁
1116
0−3−1−9
01−2−4
R₃→3R₃+R₂
1116
0−3−1−9
00−7−21

Back-sub: z = 3, y = (−9+3)/−3 = 2, x = 6−2−3 = 1.

Solution
x = 1,   y = 2,   z = 3
Example 063×3 — inconsistent system (triangular prism)

System: x + y = 3,   y + z = 4,   x + z = 2,   x + y + z = 6.

Reduce

Adding all three two-variable equations: 2x + 2y + 2z = 9, so x + y + z = 4.5. But the fourth equation says x + y + z = 6. Since 4.5 ≠ 6, the system is inconsistent.

Conclusion
No solution — the four planes have no common intersection point.
Example 073×3 — one free variable (line of solutions)

System: x + y + 2z = 4,   2x + 2y + 4z = 8,   3x + 3y + 6z = 12.

Observe

Every equation is a multiple of the first: eq 2 = 2×eq 1, eq 3 = 3×eq 1. After row reduction, only one independent equation survives.

RREF
1124
0000
0000

One pivot, two free variables (y = s, z = t). From row 1: x = 4 − s − 2t.

General Solution — a Plane
x = 4 − s − 2t,   y = s,   z = t,   s,t ∈ ℝ
Example 08Cramer's Rule — 2×2 system

System: 3x + y = 7,   x + 2y = 4. Apply Cramer's Rule.

Coefficient matrix
A = [[3, 1], [1, 2]],   det(A) = 3·2 − 1·1 = 5
x: replace col 1 with b
A₁ = [[7, 1], [4, 2]],   det(A₁) = 14 − 4 = 10 x = det(A₁)/det(A) = 10/5 = 2
y: replace col 2 with b
A₂ = [[3, 7], [1, 4]],   det(A₂) = 12 − 7 = 5 y = det(A₂)/det(A) = 5/5 = 1
Solution
x = 2,   y = 1
Example 09Matrix inverse method — 2×2

System: 4x + 7y = 29,   2x + 6y = 20. Solve using A⁻¹.

Find A⁻¹
det(A) = 4·6 − 7·2 = 10 A−1 = (1/10)[[6, −7], [−2, 4]]
x = A⁻¹b
[x, y] = (1/10)[[6·29 + (−7)·20], [(−2)·29 + 4·20]] = (1/10)[[174 − 140], [−58 + 80]] = (1/10)[34, 22] = [3.4, 2.2]
Solution
x = 17/5,   y = 11/5
Example 10Parametric system — find k for consistency

System: x + 3y − z = 2,   2x + y + z = 4,   3x + 4y + kz = 6. For which value of k is the system consistent?

Row reduce
13−12
2114
34k6

R₂ → R₂ − 2R₁: [0, −5, 3 | 0]. R₃ → R₃ − 3R₁: [0, −5, k+3 | 0].

R₃ → R₃ − R₂: [0, 0, k+3−3 | 0] = [0, 0, k | 0].

Interpret

The last row reads 0 = 0 for any k (since b = 0 in this row). So the system is consistent for all values of k. But the solution type changes: if k ≠ 0, unique solution; if k = 0, infinitely many (z is free).

Conclusion
Consistent for all k. Unique solution when k ≠ 0; infinitely many when k = 0.
Example 11Real-world application — traffic flow

Cars flow into a junction network. At each junction, cars in = cars out (conservation). The flows x₁, x₂, x₃ on three road segments satisfy:

Flow equations
x₁ − x₂ = 10  (junction A) x₂ + x₃ = 30  (junction B) x₁ + x₃ = 40  (junction C)
Row reduce
1−1010
01130
10140
R₃→R₃−R₁
1−1010
01130
01130

R₃ → R₃ − R₂ gives a zero row. x₃ is free.

Solution — traffic can flow in many valid patterns
x₁ = 40 − t,   x₂ = 30 − t,   x₃ = t,   0 ≤ t ≤ 30

The free parameter t represents the flow on segment 3. Any value between 0 and 30 gives a valid, non-negative traffic assignment.

Example 124×4 system — full Gaussian elimination

System: w + x + y + z = 10,   2w − x + y − z = 2,   w + 3x − y + z = 8,   w − x + 2y + 2z = 12.

Augment & Reduce
111110
2−11−12
13−118
1−12212

R₂ → R₂ − 2R₁, R₃ → R₃ − R₁, R₄ → R₄ − R₁:

111110
0−3−1−3−18
02−20−2
0−2112

Continue: R₃ → 3R₃ + 2R₂ gives [0, 0, −8, −6 | −42]. R₄ → 3R₄ − 2R₂ gives [0, 0, 5, 9 | 42].

Then eliminate the last variable: 8R₄+5R₃: [0,0,0,42|126] → z = 3. Back-sub: y = 42/8 − ... continuing: z = 3, y = 2, x = 3, w = 2.

Solution
w = 2,   x = 3,   y = 2,   z = 3

§ 10Common Mistakes

Mistake 1 — Forgetting to check for a contradiction before writing the solution. Always inspect the fully reduced matrix for a row [0 0 ··· 0 | c ≠ 0] before concluding the system is consistent. Many students skip this and write a "solution" for an inconsistent system.
Mistake 2 — Dropping the right-hand side during row operations. Every row operation applies to the entire augmented row, including the constant column after the bar. Applying an operation to [A] but not to [b] gives a different system with different solutions.
Mistake 3 — Setting free variables to zero without justification. When a free variable exists, the general solution must parameterise over all its values. Setting it to zero gives only one particular solution — the problem asks for the complete solution set.
Mistake 4 — Confusing "no solution" with "infinitely many solutions". An all-zero row [0 0 ··· 0 | 0] is not a contradiction — it just disappears and signals a free variable (infinitely many solutions). The contradiction comes only when the constant is non-zero: [0 0 ··· 0 | c ≠ 0].
Good habit — always verify by substituting the solution back into every original equation. A 30-second check catches arithmetic errors that might otherwise cost full marks. For parameterised solutions, verify that the formula works for at least two different values of the parameter.

§ 11Practice Quiz

Test your understanding of linear systems, solution types, geometric meaning, methods, and special cases. Instant feedback on every question.

Systems of Linear Equations

10 Questions

Cookie Settings