Cramer's Rule, Inverse Matrix, and Volume
The payoff lecture for determinants. The single number det A produces a formula for the inverse matrix (a transposed matrix of cofactors over the determinant), a formula for the solution of Ax = b (Cramer's Rule), and a formula for volume — the determinant of A is the volume of the box whose edges are the rows of A. Beautiful for algebra, disastrous for computation: elimination still wins in practice.
A formula for the inverse
Two lectures of hard work produced the formula for the determinant and its properties. This final determinant lecture is about the applications — “always this determinant packs all this information into a single number,” and that number now gives us formulas for things we’ve been computing all along without formulas.
Start with the one inverse we know by heart. For a 2×2 matrix,
What are we dividing by? The determinant — and that makes good sense, because the formula is perfect exactly as long as the determinant isn’t zero, which is exactly when the inverse exists. But can we recognize the entries ? Strang’s hint: think cofactors. The is the cofactor of — strike out row one and column one and is what’s left. The sitting in the position is the cofactor of : strike out ‘s row and column and you’re left with , and the sign is minus because sits in position and is odd.
What kind of formula is this? For a 3×3 matrix, is a sum of products of three entries (, , , , and so on), while each cofactor is a determinant one size smaller — products of two entries. In general: the determinant involves products of entries, the cofactors products of . We never noticed any of this when we computed inverses by Gauss–Jordan — tuck the identity next to , eliminate until becomes , and the identity has become . That was great numerically, “but we never knew what was going on.” Now we have the algebra instead of the algorithm.
Why the formula is true
It’s a pretty magic formula, so it needs checking. The claim to verify is
Multiply row one of against column one of — which, because of the transpose, holds the cofactors from row one. The entry of the product is
What does that sum up to? That is exactly the cofactor formula for the determinant from last lecture — entries of a row times their own cofactors give . The same happens down the whole diagonal: row two times the cofactors from row two is again, and so on to row . The cofactor expansion is a sum of products, so of course it’s secretly a matrix multiplication.
The remaining question is the off-diagonal entries: why does a row of times the cofactors from a different row automatically give zero? Check it in the 2×2 case: row one is ; the cofactors from row two are , and sure enough . But we want a reason that works for .
So is an identity — “a beautiful identity” — and dividing by gives the inverse. One thing the formula buys us that Gauss–Jordan never could: sensitivity. If you nudge the entry of a nonsingular matrix — add one to it, say — what happens to the inverse? The formula answers: watch what happens to the determinant and to the cofactors. It’s all there.
Cramer’s Rule
Second application: solving . Of course the solution is , and now there’s a formula for :
This is the very same answer elimination produced on the first day of class — but now it’s a formula, and Cramer’s Rule is a way of looking at this formula. Every component of has underneath; no surprise. The question is what sits on top. The first entry of is — cofactors times numbers. And any time you multiply cofactors by numbers, you’re computing the determinant of something. Cramer’s good idea was to realize which matrix.
Why does equal the first entry of ? Expand in cofactors down its first column — the column that is now . The entry multiplies its cofactor, which is a determinant one size smaller and is exactly of the original (the rest of is ). Then gets multiplied by , and so on: precisely the sum we wanted. The book gives another, cuter proof that leans less on cofactors, but with cofactors already on the board, this one is free.
Is the rule any good in practice? Cramer might say: all you have to do is compute determinants — the matrices and itself. Strang remembers a popular math book from his childhood, Mathematics for the Million, which explained elimination in a complicated way and then presented Cramer’s Rule as the way to go. “Actually, Cramer’s Rule is a disastrous way to go, because to compute these determinants, it takes, like, approximately forever” — he now thinks of the title as Mathematics for the Millionaire, since you’d have to pay for a hopelessly long calculation that elimination does in an instant. MATLAB would never use it. The value of the formula is algebraic, not computational: it lets you do algebra with letters instead of running algorithms. “They’re nice formulas, but I just don’t want you to use them.”
The determinant is a volume
Third application, and the amazing one: the determinant equals the volume of a box. Take a 3×3 matrix . Draw the vector to the point — row one — as one edge of a box starting at the origin. Row two gives a second edge, row three a third. Complete the figure: the proper word is parallelepiped, but “for obvious reasons, I wrote box.” Every face is a parallelogram.
The elegant proof: show that box volume satisfies the same three defining properties as the determinant — then it must be the determinant.
Property 1. If , the rows are the coordinate vectors and the box is the unit cube, volume one. Determinant one. ✓
Go up one level, and bring back the previous chapter: let , an orthogonal matrix — orthonormal columns, perpendicular unit vectors. The box is again a cube, just rotated in space, so its volume is one. Is ? Start from the defining equation and take determinants of both sides. Rule 9 (the product rule) pays off: . Rule 10 pays off: . So and . ✓
Property 2. Exchanging two rows reverses the sign of the determinant — but it doesn’t change the box at all, and it doesn’t change the absolute value. No problem.
Property 3a. Stretch one edge — double row one, keeping the other edges fixed. The volume doubles: the new box is two identical copies stacked together. And doubling a row of the matrix doubles the determinant — that’s rule 3a, factoring out of a row. ✓
Property 3b — linearity in a single row, of a matrix with first row splitting into two determinants — is the one that forces us away from right angles, and it’s where the lecture’s clock runs out. Strang leaves it: “the book has a carefully drawn figure to show why that works.” With all the defining properties matched, volume equals determinant.
Areas without lengths or angles
In two dimensions, the box is a parallelogram and volume means area. Take the parallelogram with one edge to , another to , and fourth vertex at . Last year you’d have computed base times height: the base is , and the height is “other revolting stuff” — square roots everywhere. Now:
No square roots. Totally rememberable — it’s exactly the formula we’ve studied for three lectures. This, more than Cramer’s Rule, is the formula that impresses Strang: if you know the coordinates of the corners, you have a great formula for area or volume with no lengths, no angles, no heights.
Next lectures are about eigenvalues — “so we’re really into the big stuff.”
Problems
Work these before revealing the solutions. Everything you need is in the lecture’s three formulas.
Use the cofactor formula to invert
Show solution
The matrix is triangular, so .
Compute the nine cofactors :
So
Check the entry of : . ✓ (Notice the inverse of an upper triangular matrix is upper triangular — the formula shows why: the cofactors , , below the diagonal of all vanish.)
Solve by Cramer’s Rule:
Show solution
Replace column one by for , column two for :
So
Check: ✓ and ✓.
Let
Write down the cofactor matrix , compute the product in full, and explain — using the “matrix with two equal rows” argument from lecture — why the off-diagonal entries had to be zero.
Show solution
The cofactors: , , , , so
Multiply:
since .
The entry is row one of times the cofactors from row two of : . That is exactly the cofactor expansion of the determinant of the “screwed up” matrix
— row one of appearing twice, expanded along its second row. A matrix with two equal rows is singular, so the expansion must give zero.
Find the volume of the parallelepiped with edges from the origin to , , and . Is the ordering of these three edges right-handed or left-handed?
Show solution
Put the edges in the rows and take the determinant, expanding along row one:
The volume is . Since the determinant is positive, the three edges in this order form a right-handed box. (Exchanging any two of the edges would flip the sign to — same volume, left-handed orientation.)
Find the area of the triangle with vertices , , and , using the lecture’s determinant formula with the column of ones. Then verify by translating the triangle so one vertex is at the origin.
Show solution
The formula:
Subtract row one from rows two and three (determinant unchanged):
expanding down the third column. So the area is .
Verification by translation: shift every vertex by , giving , , . Then
The row subtractions in the 3×3 determinant were exactly this translation to the origin.