Skip to content

Cheatsheet: Cramer's rule

To solve M · v = b (M invertible), each coordinate is a ratio of determinants:

x = det(M with first column replaced by b) / det(M)
y = det(M with second column replaced by b) / det(M)

General n by n: the i-th unknown = det(M with i-th column replaced by b) / det(M).

  1. The parallelogram spanned by [x, y] and j-hat has signed area x (base 1, height x).
  2. Apply M: areas scale by det(M), so the new area is det(M) · x.
  3. The transformed parallelogram is spanned by b and the second column of M, so its area is det([b | second column]).
  4. Equate: det(M) · x = det([b | second column]), so x = det([b | second column]) / det(M).
  5. The same argument with i-hat gives y.

A coordinate is a signed area; transformations scale area by the determinant. That is the whole idea.

Dividing by det(M) requires it to be nonzero. det(M) = 0 is the collapsed case (no unique solution); the division by zero is the rule honestly reporting that.

Systemdet(M)xy
[[2,1],[1,1]]·v = [3,2]1det([[3,1],[2,1]])/1 = 1det([[2,3],[1,2]])/1 = 1
[[3,-1],[1,2]]·v = [7,0]7det([[7,-1],[0,2]])/7 = 2det([[3,7],[1,0]])/7 = -1
[[2,4],[1,2]]·v = [3,2]0undefinedundefined (no unique solution)

First system matches the inverses lesson’s [1, 1]. Checks: 2(1)+1=3, 1+1=2; 3(2)-(-1)=7, 2+2(-1)=0.

Rarely used in practice; iterative solvers and Gaussian elimination are faster for real systems. Cramer’s value is conceptual: an explicit, geometrically-derived solution formula. It closes the solve-the-system question from the inverses lesson.

  • Replacing the wrong column. For x replace column 1; for y replace column 2.
  • Forgetting to divide by det(M). The answer is a ratio; the denominator is the original determinant.
  • Using it when det(M) = 0. No unique solution; the division by zero is the signal.
  • Using it on large systems. Determinant-per-unknown is slow; use elimination or an iterative solver.

Each unknown is the determinant of the matrix with its column swapped for the target, over the determinant of the matrix, because a coordinate is an area and transformations scale area by the determinant.