Skip to content

Summary: Cramer's rule

Several lessons ago we said the solution to M · v = b is M^-1 · b, then never computed it. Cramer’s rule is one way to get the answer directly from the matrix entries, and it is worth seeing not because it is fast (it is not) but because it falls out of a single fact you already own. The whole lesson reduces to this: each unknown is the determinant of the matrix with its column swapped for the target, over det(M), because a coordinate is an area and transformations scale area by the determinant. This is the scan-it-in-five-minutes version.

  • Cramer’s rule: for an invertible 2x2 system M · v = b, x = det(M with first column replaced by b) / det(M) and y = det(M with second column replaced by b) / det(M). To find a coordinate, swap the matching column of M for b, take the determinant, divide by det(M).
  • The rule rests on one geometric idea: a coordinate is a signed area. The parallelogram spanned by the unknown [x, y] and j-hat has signed area exactly x (base 1 along the y-axis, height x); the one spanned by i-hat and [x, y] has area y. (Check: det([[x, 0], [y, 1]]) = x.)
  • Applying M recovers it. Every area scales by det(M), so the area x becomes det(M)·x. But M sends the parallelogram’s sides [x, y] and j-hat to b and the second column of M, so the transformed area is det([b | second column]). Equating the two and dividing gives the formula. The same argument with i-hat gives y.
  • It generalizes: for an n by n invertible system, the i-th unknown is det(M with its i-th column replaced by b) / det(M). In 3D, areas become volumes scaled by the 3x3 determinant; the picture is identical, only the word changes.
  • It requires det(M) ≠ 0. When det(M) = 0, the rule divides by zero, which is the honest report that the collapsed system (from the inverses lesson) has no unique solution. The division by zero is a feature, not a glitch.
  • Worked anchors: [[2,1],[1,1]]·v = [3,2] gives [1,1] (det 1, matching the inverses lesson); [[3,-1],[1,2]]·v = [7,0] gives [2,-1] (det 7); the non-invertible [[2,4],[1,2]]·v = [3,2] has det 0, so the rule correctly refuses.
  • Honest about AI: Cramer’s rule is rarely used in practice (iterative solvers and Gaussian elimination are faster for real systems). Its value is closure and intuition: it answers the solve-the-system question the inverses lesson left open, with a formula derived from nothing but “areas scale by the determinant.”

Before this lesson, Cramer’s rule (if you had met it) was probably a memorized formula with arbitrary-looking column swaps. Now it is a geometric statement: each unknown is an area, and dividing transformed areas by det(M) undoes the scaling to recover it. More broadly, you have closed the loop the inverses lesson opened, seeing one concrete way to compute the solution it only described abstractly. The next lesson keeps the same vectors but changes the question: what happens to a vector’s coordinates when you change the basis you measure it against?