- What Is a Linear Equation?
- Writing a System in Matrix Form Ax = b
- The Three Solution Types
- Geometric Interpretation in 2D and 3D
- Method 1, Substitution
- Method 2: Elimination (by Hand)
- Method 3, Gaussian Elimination (Matrix Method)
- Method 4, Cramer's Rule
- 12 Fully Worked Examples
- Common Mistakes
- 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.
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.
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.
| 2 | −1 | 3 |
| 1 | 4 | −1 |
| −3 | 2 | 1 |
| 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.
| 2 | −1 | 3 | 10 |
| 1 | 4 | −1 | 5 |
| −3 | 2 | 1 | −2 |
§ 03The Three Solution Types
Every system of linear equations falls into exactly one of three categories. There is no fourth option.
| Type | Description | Terminology | Row 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. |
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.
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:
§ 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.
§ 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.
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.
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:
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.
where Aj is the matrix formed by replacing the j-th column of A with the vector b.
§ 0912 Fully Worked Examples
System: y = 3x − 1 and 2x + y = 9.
y is already isolated. Substitute y = 3x − 1 into equation 2: 2x + (3x − 1) = 9 → 5x = 10 → x = 2.
y = 3(2) − 1 = 5.
Eq 1: 5 = 3(2) − 1 = 5 ✓. Eq 2: 2(2) + 5 = 9 ✓.
System: 3x + 2y = 12 and 5x − 2y = 4.
The y-coefficients are already +2 and −2. Adding the two equations: (3x + 2y) + (5x − 2y) = 12 + 4 → 8x = 16 → x = 2.
Substitute into equation 1: 3(2) + 2y = 12 → 2y = 6 → y = 3.
Geometric meaning: the two lines cross at the point (2, 3).
System: 2x + 4y = 6 and x + 2y = 5.
| 2 | 4 | 6 |
| 1 | 2 | 5 |
| 1 | 2 | 5 |
| 0 | 0 | −4 |
Row 2 reads 0 = −4. Contradiction.
System: 4x − 6y = 10 and −2x + 3y = −5.
Multiply equation 2 by −2: 4x − 6y = 10, which is identical to equation 1. The two equations are the same line.
| 2 | −3 | 5 |
| 0 | 0 | 0 |
After scaling R₁ → (1/2)R₁: x − (3/2)y = 5/2. y is free (y = t).
System: x + y + z = 6, 2x − y + z = 3, x + 2y − z = 2.
| 1 | 1 | 1 | 6 |
| 2 | −1 | 1 | 3 |
| 1 | 2 | −1 | 2 |
| 1 | 1 | 1 | 6 |
| 0 | −3 | −1 | −9 |
| 0 | 1 | −2 | −4 |
| 1 | 1 | 1 | 6 |
| 0 | −3 | −1 | −9 |
| 0 | 0 | −7 | −21 |
Back-sub: z = 3, y = (−9+3)/−3 = 2, x = 6−2−3 = 1.
System: x + y = 3, y + z = 4, x + z = 2, x + y + z = 6.
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.
System: x + y + 2z = 4, 2x + 2y + 4z = 8, 3x + 3y + 6z = 12.
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.
| 1 | 1 | 2 | 4 |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 |
One pivot, two free variables (y = s, z = t). From row 1: x = 4 − s − 2t.
System: 3x + y = 7, x + 2y = 4. Apply Cramer's Rule.
System: 4x + 7y = 29, 2x + 6y = 20. Solve using A⁻¹.
System: x + 3y − z = 2, 2x + y + z = 4, 3x + 4y + kz = 6. For which value of k is the system consistent?
| 1 | 3 | −1 | 2 |
| 2 | 1 | 1 | 4 |
| 3 | 4 | k | 6 |
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].
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).
Cars flow into a junction network. At each junction, cars in = cars out (conservation). The flows x₁, x₂, x₃ on three road segments satisfy:
| 1 | −1 | 0 | 10 |
| 0 | 1 | 1 | 30 |
| 1 | 0 | 1 | 40 |
| 1 | −1 | 0 | 10 |
| 0 | 1 | 1 | 30 |
| 0 | 1 | 1 | 30 |
R₃ → R₃ − R₂ gives a zero row. x₃ is free.
The free parameter t represents the flow on segment 3. Any value between 0 and 30 gives a valid, non-negative traffic assignment.
System: w + x + y + z = 10, 2w − x + y − z = 2, w + 3x − y + z = 8, w − x + 2y + 2z = 12.
| 1 | 1 | 1 | 1 | 10 |
| 2 | −1 | 1 | −1 | 2 |
| 1 | 3 | −1 | 1 | 8 |
| 1 | −1 | 2 | 2 | 12 |
R₂ → R₂ − 2R₁, R₃ → R₃ − R₁, R₄ → R₄ − R₁:
| 1 | 1 | 1 | 1 | 10 |
| 0 | −3 | −1 | −3 | −18 |
| 0 | 2 | −2 | 0 | −2 |
| 0 | −2 | 1 | 1 | 2 |
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.
§ 10Common Mistakes
§ 11Practice Quiz
Test your understanding of linear systems, solution types, geometric meaning, methods, and special cases. Instant feedback on every question.