Lesson 14: Matrices and Systems: Inverses and Cramer's Rule
🎧 Listen to this lesson
A system of equations asks for values satisfying several conditions at once; a matrix is a machine for solving many such systems with the same coefficients. This lesson covers determinants, inverses, and Cramer's rule — and the judgement to know which tool fits, including recognising the systems that have no unique solution at all.
Matrices, determinants and inverses
A 2×2 matrix A = [[a, b], [c, d]] has determinant det A = ad − bc, a single number measuring (among other things) whether the matrix can be undone. If det A ≠ 0 the inverse exists:
A^−1 = (1/(ad − bc)) · [[d, −b], [−c, a]] (swap a and d, negate b and c, divide by det)
Worked example: A = [[2, 1], [3, 4]] has det = 8 − 3 = 5, so A^−1 = (1/5)[[4, −1], [−3, 2]]. Matrix multiplication is row-by-column: for AB, entry (i, j) is row i of A dotted with column j of B — and it is not commutative: with B = [[5, 6], [7, 8]], AB = [[17, 20], [43, 50]] but BA = [[28, 29], [38, 39]]. The verification A·A^−1 = I (identity matrix) is a two-line check worth performing every time: row 1 · column 1: (2·4 + 1·(−3))/5 = 5/5 = 1 ✓, row 1 · column 2: (−2 + 2)/5 = 0 ✓.
Solving systems with the inverse
The system 2x + y = 7, 3x + 4y = 18 is A·x = b with A as above, so x = A^−1b = (1/5)[[4, −1], [−3, 2]]·(7, 18) = (1/5)(28 − 18, −21 + 36) = (1/5)(10, 15) = (2, 3). Check in the originals: 2(2) + 3 = 7 ✓, 3(2) + 4(3) = 18 ✓. The inverse method earns its keep when the same A serves many right-hand sides — one inversion, then each new system is a single matrix multiplication.
Cramer's rule
Cramer's rule solves for one variable at a time as a ratio of determinants. For the same system, D = det[[2, 1], [3, 4]] = 5; replace the x-column with the constants: D_x = det[[7, 1], [18, 4]] = 28 − 18 = 10, so x = D_x/D = 2; D_y = det[[2, 7], [3, 18]] = 36 − 21 = 15, so y = 3. The 3×3 version needs the 3×3 determinant (expand along a row: alternate signs, multiply by the 2×2 minor). For the system x + y + z = 6, x − y + z = 2, 2x + y − z = 1: D = 6, D_x = 6, D_y = 12, D_z = 18, giving (x, y, z) = (1, 2, 3) — verify: 1 + 2 + 3 = 6 ✓, 1 − 2 + 3 = 2 ✓, 2 + 2 − 3 = 1 ✓. Cramer's rule is elegant and reveals structure, but computationally it explodes for large systems; professionals use Gaussian elimination, which you met as row operations and which scales.
When systems have no unique solution
Everything hinges on D (the determinant of the coefficient matrix). If D = 0, the system has either no solution (inconsistent — parallel lines in 2D) or infinitely many (dependent — the same line twice), and neither inverses nor Cramer apply. Example: 2x + y = 7 and 4x + 2y = 10 have D = 4 − 4 = 0; the second equation claims 2x + y = 5, contradicting the first — no solution. With 4x + 2y = 14 instead, it is the same line doubled — infinitely many solutions. The determinant is a litmus test to run *before* investing in a solution method.
Modelling: mixture and ticket problems
Matrices organise any "two constraints, two unknowns" situation. Ticket problem: a theatre sells 250 tickets for $2,600, adults at $12 and children at $7. With a adults and c children: a + c = 250, 12a + 7c = 2600. D = 7 − 12 = −5; D_a = det[[250, 1], [2600, 7]] = 1750 − 2600 = −850, so a = 170; D_c = det[[1, 250], [12, 2600]] = 2600 − 3000 = −400, so c = 80. Check: 170 + 80 = 250 ✓, 12·170 + 7·80 = 2040 + 560 = 2600 ✓. Chemists (mixtures), dietitians (nutrient targets) and economists run the identical calculation with more rows.
Common mistakes
- Dividing by the determinant at the wrong step, or not at all. A^−1 = (1/det)·[[d, −b], [−c, a]] — the (1/5) factor is part of the inverse. Omitting it gives solutions 5 times too large in the worked example.
- Assuming AB = BA. The example above gives AB ≠ BA — matrix multiplication order is meaning: row-times-column in the stated order, always.
- Cramer with the wrong column replaced. D_x replaces the coefficient column of x with the constants, keeping the y-column intact. Replacing the constants' position or negating them corrupts everything downstream.
- Pushing ahead when D = 0. Cramer's rule with D = 0 divides by zero; the correct response is to stop and classify the system (none vs infinitely many) by comparing the equations.
- Sign errors in the 3×3 expansion. The cofactor sign pattern is + − + / − + − / + − + — a checkerboard starting with + at (1,1). Most 3×3 determinant errors are a single wrong sign; verify with a check substitution of your final solution.
Exam Experience
1. det [[3, 5], [2, 4]] =
- (A) 22
- (B) 2
- (C) −2
- (D) 7
Answer: (B). ad − bc = 3·4 − 5·2 = 12 − 10 = 2. (A) adds instead of subtracting the cross product; (C) reverses the subtraction.
2. The inverse of [[1, 2], [0, 3]] is
- (A) (1/3)[[3, −2], [0, 1]]
- (B) (1/3)[[3, 2], [0, 1]]
- (C) [[3, −2], [0, 1]]
- (D) (1/3)[[1, −2], [0, 3]]
Answer: (A). det = 3; swap the diagonal (3 and 1 trade places), negate the off-diagonal 2 → −2 (the 0 stays 0), divide by 3. (C) forgets the 1/det factor — the costliest habit in this topic.
3. Using Cramer's rule on 2x − y = 3, x + 4y = 5, the denominator determinant D is
- (A) 7
- (B) 9
- (C) −9
- (D) 8
Answer: (B). D = det[[2, −1], [1, 4]] = 2·4 − (−1)·1 = 8 + 1 = 9. (A) comes from 8 − 1 — mishandling the negative entry −1, the classic Cramer slip.
Constructed response. Solve the system x + y + z = 6, x − y + z = 2, 2x + y − z = 1 using Cramer's rule. (a) Compute D for the coefficient matrix. (b) Compute D_x, D_y, D_z and the solution. (c) Verify your solution in all three original equations.
Scoring guide. (a) 2 points: expanding det[[1, 1, 1], [1, −1, 1], [2, 1, −1]] along the first row: 1·((−1)(−1) − 1) − 1·(−1 − 2) + 1·(1 + 2) = 0 + 3 + 3 = 6 — 1 point for the expansion structure with correct signs, 1 point for D = 6. (b) 3 points: D_x = 6, D_y = 12, D_z = 18 (each from replacing the corresponding column with (6, 2, 1)) — 2 points for the three determinants; (x, y, z) = (1, 2, 3) — 1 point. (c) 1 point: 1 + 2 + 3 = 6 ✓; 1 − 2 + 3 = 2 ✓; 2(1) + 2 − 3 = 1 ✓ — all three verified.
Going deeper: Gaussian elimination and a determinant shortcut
Gaussian elimination solves systems by row operations that preserve the solution: swap rows, scale a row, add a multiple of one row to another. For the Exam Experience system (x + y + z = 6, x − y + z = 2, 2x + y − z = 1): subtract row 1 from row 2 → −2y = −4, so y = 2 directly. Add: subtracting 2×row 1 from row 3 gives −y − 3z = −11; with y = 2, −3z = −9, z = 3; back-substitute into row 1: x = 6 − 2 − 3 = 1. Solution (1, 2, 3) — same answer as Cramer, reached mechanically. Elimination is O(n^3) work while Cramer via expansion is O(n!) — that gap is why computers eliminate and why Cramer is a small-system and theory tool. Notice the elimination above also *computes* the determinant's nonzeroness implicitly: the process only stalls (zero pivot with nothing to swap in) when D = 0.
Determinants measure area and volume. For vectors (a, b) and (c, d) in the plane, |det [[a, b], [c, d]]| is the area of the parallelogram they span. Triangle with vertices (0, 0), (4, 1), (2, 5): edge vectors (4, 1) and (2, 5), determinant 4×5 − 1×2 = 18, parallelogram area 18, triangle area 9. This is why det = 0 means degenerate systems: the "parallelogram" has collapsed flat — the vectors are parallel, the equations dependent. Zero area, zero determinant, no unique solution: one fact in three dialects.
Workshop: matrices as motions, triangular determinants
A matrix is a motion. A = [[0, −1], [1, 0]] sends (x, y) to (−y, x): the point (3, 1) goes to (−1, 3) — a rotation of 90° anticlockwise about the origin. Multiplying a vector by a matrix transforms it (rotation, reflection, scaling, shear); solving Ax = b asks which input lands on a target — the geometric meaning beneath Lesson 14's algebra, and the reason matrices run computer graphics.
Triangular determinants. If a matrix is triangular (zeros all above or all below the diagonal), its determinant is the product of the diagonal: det [[2, 1, 5], [0, 3, −1], [0, 0, −4]] = 2 × 3 × (−4) = −24, with no expansion needed. Gaussian elimination (X-section) works precisely by *making* a matrix triangular through row operations — the determinant, the solution and the geometry all become readable at once.
🎬 Watch & Learn
Free video lessons on “Matrices and Systems: Inverses and Cramer's Rule” — pick a result below: