The Determinant & Matrix Inverse
Linear Algebra Fundamentals
Chapter 7 · The Determinant & Matrix Inverse
Chapter 6 ended with a forward reference: a single number, computed directly from a matrix, that instantly reveals whether a system of equations has a unique solution. That number is the determinant. This chapter defines it, gives it a genuine geometric meaning, and uses it to build the matrix inverse — the closest thing a matrix has to "dividing by" itself.
The Determinant Formula
For a 2×2 matrix, the determinant is refreshingly simple:
det([[a, b], [c, d]]) = ad − bc
This is exactly the calculation Chapter 6 used to flag a "no unique solution" system, and it's exactly Chapter 3's own 2D "pseudo-cross-product" (a₁b₂ − a₂b₁) — stacking two vectors as the rows of a matrix and taking the determinant is the same number as taking their 2D cross product.
Geometric Meaning: Area Scaling
A matrix, per Chapter 5, transforms every point in the plane. The unit square (corners at [0,0], [1,0], [0,1], [1,1], area exactly 1) gets mapped to some parallelogram — and |det(A)| is exactly that parallelogram's area. The determinant is the transformation's area-scaling factor.
| Transformation (from Ch.5) | Matrix | det | What it means |
|---|---|---|---|
| Scale (2×, 0.5×) | [[2, 0], [0, 0.5]] | 1.0 | Stretched one way, squeezed the other — net area unchanged |
| Rotate 90° | [[0, -1], [1, 0]] | 1 | Area exactly preserved — rotations never change area |
| Reflect (x-axis) | [[1, 0], [0, -1]] | -1 | Area magnitude preserved, but the sign flips |
|det| = 1.
The Determinant as a Singularity Test
If det(A) = 0, the transformation squashes the entire plane down onto a line (or a single point) — all area is destroyed, mapped to zero. A matrix with a zero determinant is called singular. This is precisely why Chapter 6's two "no unique solution" systems both had determinant 0: their coefficient matrices collapse the plane, so there's either no point that lands exactly on b, or a whole line of points that do.
The Matrix Inverse
The inverse of a matrix A, written A⁻¹, is the matrix satisfying A A⁻¹ = A⁻¹ A = I — the matrix equivalent of a reciprocal. For 2×2 matrices, it has a direct formula built from the determinant:
A⁻¹ = (1 / det(A)) × [[d, −b], [−c, a]]
Worked example, reusing Chapter 6's own system matrix A = [[1, 1], [2, -1]], det(A) = -3:
| Step | Result |
|---|---|
| Swap diagonal, negate off-diagonal | [[-1, -1], [-2, 1]] |
| Multiply by 1/det = 1/(-3) | A⁻¹ = [[1/3, 1/3], [2/3, -1/3]] |
Verifying A × A⁻¹ = I: [[1×⅓+1×⅔, 1×⅓+1×(-⅓)], [2×⅓+(-1)×⅔, 2×⅓+(-1)×(-⅓)]] = [[1, 0], [0, 1]] ✓.
det(A) — so whenever det(A) = 0, the inverse is undefined. This is exactly consistent with the geometric picture: a transformation that collapses the plane to a line has thrown information away, and there's no way to "un-throw" it back. A singular matrix has no inverse, full stop.
Solving a System With the Inverse
Since A x = b and A⁻¹ A = I, multiplying both sides by A⁻¹ gives x = A⁻¹ b directly — no elimination needed, if the inverse is already known. Reusing Chapter 6's exact system (A = [[1,1],[2,-1]], b = [5, 1]): A⁻¹ b = [⅓×5 + ⅓×1, ⅔×5 + (-⅓)×1] = [2, 3] — exactly the x = 2, y = 3 Chapter 6 found by elimination.
A x = b using elimination-based methods internally (Chapter 6's own np.linalg.solve), even when they could compute A⁻¹ instead. The inverse is conceptually clean and useful when the same A needs to be solved against many different b vectors, but it's rarely the practical first choice for a single system.
Determinants & Inverses in Code
Hands-On Exercises
Compute the determinant of M = [[3, 2], [1, 4]]. Since it's nonzero, compute the full inverse M⁻¹ using this chapter's own formula, and verify your answer by computing M × M⁻¹ and confirming it equals the identity matrix.
Reusing Chapter 6's Exercise 1 system (3x + y = 11, x − y = 1, coefficient matrix A = [[3, 1], [1, -1]]), compute A⁻¹ and use it to solve for x = A⁻¹ b with b = [11, 1]. Confirm your answer matches the x = 3, y = 2 found by Gaussian elimination in Chapter 6.
Given N = [[6, 3], [4, 2]], compute its determinant and state whether N has an inverse. Then look at N's two columns, [6, 4] and [3, 2], and explain — in terms of one column being a scalar multiple of the other — why this particular matrix was always going to be singular, before you even computed the determinant.
Chapter 7 Quick Reference
- 2×2 determinant:
det([[a,b],[c,d]]) = ad − bc— same formula as Chapter 3's 2D cross product - Geometric meaning:
|det(A)|is the transformation's area-scaling factor; the sign reveals whether orientation flips (negative = reflection-like) - Singular matrix:
det(A) = 0— the transformation collapses the plane to a line or point, and no inverse exists - A zero determinant is exactly why a Chapter 6 system has no unique solution — no solution, or infinitely many
- 2×2 inverse:
A⁻¹ = (1/det(A)) × [[d, −b], [−c, a]], satisfyingA A⁻¹ = A⁻¹ A = I - A system can be solved as
x = A⁻¹ b, but Gaussian elimination is usually preferred in practice for efficiency and numerical stability - Next chapter: Vector spaces, span, basis & dimension