- Cramer's rule: xⱼ = det Bⱼ / det A, where Bⱼ is A with its column j replaced by b.
- It needs det A ≠ 0, the same condition as for A⁻¹ to exist.
- The inverse: (A⁻¹)ᵢⱼ = Cⱼᵢ / det A. The indices swap: the cofactor matrix is transposed.
- For 2 by 2 this is exactly the formula from lesson 3.
The café, by Cramer's rule
Coffee x, croissant y: x + y = 5 and x + 2y = 7. So A = 1112 and b = 57.
Same answer as lesson 2: €3 and €2. The rule in general: xⱼ = det Bⱼ / det A, where Bⱼ is A with its column j replaced by b.
Why it works (2 by 2)
Call the two columns of A c₁ and c₂ (column 1 and column 2), so b = x₁c₁ + x₂c₂. Put b in column 1 and use the rules from slide 4 (they hold for columns, since det Aᵀ = det A, slide 5):
In pictures: the parallelogram of b and c₂ has x₁ times the area of the parallelogram of c₁ and c₂. The reason: b = x₁c₁ + x₂c₂, and the x₂c₂ part only slides the tip along the direction of c₂, which does not change the area (a shear, slide 4); what is left is x₁c₁, which multiplies the area by x₁. The same works for every column and every size.
A worked example
The inverse from cofactors
Column j of A⁻¹ solves Ax = (column j of I). Take b = 10. Then B₁ = 1a₁₂0a₂₂ has det a₂₂, which is the cofactor C₁₁. And B₂ = a₁₁1a₂₁0 has det −a₂₁, which is the cofactor C₁₂. So column 1 of A⁻¹ is C₁₁C₁₂ / det A. Row 1 of the cofactor matrix C (the matrix of all cofactors Cᵢⱼ, with Cᵢⱼ in row i, column j) became column 1 of A⁻¹. That is why C is transposed:
That is the 2 by 2 recipe from lesson 3 (swap, flip signs, divide by the determinant), now explained. With numbers, for the café matrix:
Keep reading with the full course
Finish lesson 6 and you will be able to: see a matrix as a move of the plane, and build one from where two arrows land.
Still locked here:
- The rest of this explanation
- 4 more examples with step-by-step solutions
- Five extra members-only problems with worked solutions
$20 once, lifetime access. Lessons 1 to 3 stay free.
Examples
Example 1 · Cramer for another 2 by 2
x + 2y = 5, 3x + 4y = 6.

Questions and comments
Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.