MATH 250 · Mathematics for Economics II
Determinants, Inverses and Cramer's Rule
The determinant tests whether a matrix can be undone, and the inverse and Cramer's rule solve systems directly.
Key takeaways
- The determinant of a square matrix is a single number; if it is zero, the matrix has no inverse and the system is not uniquely solvable.
- For a 2 × 2 matrix with rows (a, b) and (c, d), the determinant is ad − bc.
- The inverse A⁻¹ satisfies A × A⁻¹ = I, and it solves Ax = b in one step: x = A⁻¹b.
- Cramer's rule finds each unknown as a ratio of two determinants.
- Row reduction, the inverse and Cramer's rule all give the same answer; they differ in speed and in what they reveal.
Picture Maya, who runs a smoothie cart, and her friend Dev, who keeps her books. Every week Maya's stockroom holds a different amount of bananas and berries, and every week Dev solves the same two equations again to find how many smoothies of each kind use everything up. Dev is tired of repeating the row reduction from Solving Linear Systems With Matrices. He asks a lazy, sensible question: could I solve the system once, for all possible stockrooms, and just plug in the numbers each week?
Yes, and the tool for it is the inverse matrix. An inverse undoes what a matrix does, the way dividing by 5 undoes multiplying by 5. Not every matrix has one, and there is a single number, the determinant, that tells you at a glance whether it does. A third method, Cramer's rule, solves one unknown at a time using only determinants. In this lesson we meet all three, compute them with real numbers, and see what they mean for economic models.
Division, for matrices
With ordinary numbers, to solve 5x = 40 you divide by 5, or multiply by 1/5, which is 5⁻¹. The number 1/5 is the inverse of 5, because 5 × 1/5 = 1.
Matrices have a version of this. The inverse of a square matrix A, written A⁻¹, is the matrix that satisfies
A × A⁻¹ = A⁻¹ × A = I
where I is the identity matrix from Vectors and Matrices. If you have Ax = b and you multiply both sides on the left by A⁻¹, you get A⁻¹Ax = A⁻¹b. The left side simplifies to Ix = x. So the solution is
x = A⁻¹b
There is no matrix "division" symbol. You multiply by the inverse, and you must put it on the correct side, because order matters.
The determinant: does the inverse exist?
Not every number has an inverse: zero does not. The same is true of matrices, and the determinant is the test. For a 2 × 2 matrix with first row (a, b) and second row (c, d), it is
det A = a × d − b × c
Take Maya's recipe matrix, with rows (2, 1) and (1, 3). Its determinant is 2 × 3 − 1 × 1 = 6 − 1 = 5. Not zero, so the inverse exists.
Now take a matrix with rows (1, 2) and (2, 4). The determinant is 1 × 4 − 2 × 2 = 0. The second row is exactly twice the first. Those two equations say the same thing, so the system cannot pin down a unique answer. We call a matrix with determinant zero singular.
There is a picture. Think of the columns of a 2 × 2 matrix as two arrows. The absolute value of the determinant is the area of the parallelogram they span. For Maya's matrix the columns are (2, 1) and (1, 3), and the area is 5. For the singular matrix the arrows (1, 2) and (2, 4) point the same way and the "parallelogram" is flat, with area 0.
The inverse of a 2 × 2 matrix
For a matrix with rows (a, b) and (c, d), and determinant D = ad − bc not equal to zero, the inverse has rows (d, −b) and (−c, a), each divided by D. In words: swap the two diagonal entries, change the signs of the other two, and divide everything by the determinant.
For Maya's matrix, a = 2, b = 1, c = 1, d = 3, D = 5:
A⁻¹ = (1/5) × [ 3 −1 ]
[ −1 2 ] Check it. Multiply A by A⁻¹, ignoring the 1/5 for the moment. Row 1 of A is (2, 1); column 1 is (3, −1): 6 − 1 = 5. Column 2 is (−1, 2): −2 + 2 = 0. Row 2 of A is (1, 3): with column 1 gives 3 − 3 = 0; with column 2 gives −1 + 6 = 5. The product is 5 times the identity, and the 1/5 turns it into I. ✓
Solving with the inverse
Now Dev has what he wanted. For any stockroom b = (bananas, berries), the plan is
x = A⁻¹b = (1/5) × (3 × bananas − berries, −bananas + 2 × berries)
Plug in this week's 40 bananas and 70 cups of berries:
- Strawberry smoothies: (3 × 40 − 70)/5 = (120 − 70)/5 = 10
- Green smoothies: (−40 + 2 × 70)/5 = (−40 + 140)/5 = 20
Same answer as before. Next week the stockroom holds 60 bananas and 90 cups: strawberry = (180 − 90)/5 = 18 and green = (−60 + 180)/5 = 24. No new elimination, just two quick calculations. That is the value of an inverse: solve once, reuse for every right-hand side.
The inverse also reveals how the answer reacts to changes. If bananas rise by 5, strawberry smoothies rise by 3 × 5/5 = 3 and green smoothies fall by 5/5 = 1, since the leftover bananas go to the strawberry recipe, which is banana-heavy. This is the kind of question taken up in Implicit Differentiation and Comparative Statics, where the effect of a parameter on the equilibrium is read off the inverse.
Cramer's rule
Sometimes you only want one unknown, and you would rather not build the whole inverse. Cramer's rule gives each unknown as a ratio. To find the unknown in position j, replace column j of A with the right-hand side b. Take that determinant and divide by det A.
For Maya's system, det A = 5:
- To find s, replace column 1 by b = (40, 70). The new matrix has rows (40, 1) and (70, 3). Its determinant is 40 × 3 − 1 × 70 = 120 − 70 = 50. So s = 50/5 = 10.
- To find g, replace column 2. Rows are (2, 40) and (1, 70). Determinant: 2 × 70 − 40 × 1 = 140 − 40 = 100. So g = 100/5 = 20.
The two ratios agree with everything else. A caution: Cramer's rule is wonderful for 2 × 2 and 3 × 3 problems and for theory, because it shows the answer as an explicit formula. For large systems it is slow, and computers use row reduction instead.
Determinants of a 3 × 3 matrix
For three equations you need a bigger determinant. Expand along the first row: take each entry of the row, multiply by the determinant of the 2 × 2 matrix left when you cross out that entry's row and column, and alternate the signs +, −, +.
Use the matrix from the last lesson, with rows (1, 1, 1), (2, −1, 1) and (1, 2, −1):
det = 1 × [(−1)(−1) − (1)(2)] − 1 × [(2)(−1) − (1)(1)] + 1 × [(2)(2) − (−1)(1)]
= 1 × (1 − 2) − 1 × (−2 − 1) + 1 × (4 + 1)
= −1 + 3 + 5 = 7 The determinant is 7, not zero, so a unique solution exists. Cramer's rule then gives each unknown. For z, replace the third column by b = (6, 3, 2). The matrix has rows (1, 1, 6), (2, −1, 3), (1, 2, 2). Expanding along the first row:
1 × [(−1)(2) − (3)(2)] − 1 × [(2)(2) − (3)(1)] + 6 × [(2)(2) − (−1)(1)]
= 1 × (−8) − 1 × (1) + 6 × 5 = −8 − 1 + 30 = 21 So z = 21/7 = 3, which matches the answer found by elimination. Row operations that only add a multiple of one row to another do not change the determinant. Swapping two rows flips its sign. That explains why the staircase in the last lesson ended with −7 on the diagonal: 1 × 1 × (−7) gives −7, and the one swap turns it into +7.
Why the determinant is the right test
The area picture explains the whole story. A matrix acts like a machine that moves every point of the plane. It stretches, squeezes and turns shapes. Take the unit square, with corners at (0, 0), (1, 0), (0, 1) and (1, 1). Maya's matrix sends it to the parallelogram spanned by (2, 1) and (1, 3), which has area 5. So the machine multiplies every area by 5. The determinant is that scale factor.
Now ask whether the machine can be reversed. If areas get multiplied by 5, you can reverse it by shrinking them by 5. That is exactly the 1/5 in the inverse. But the singular matrix with rows (1, 2) and (2, 4) squashes the whole plane onto a single line. Once many points have landed on the same spot, nothing can tell you which one you started from. The squashing cannot be undone, so no inverse exists. The determinant, the area scale, is zero.
This also explains why the formula divides by the determinant. An inverse must scale areas by 1 over the determinant, and one cannot divide by zero.
The same idea carries to three equations, where the determinant measures volume, and to hundreds, where the picture is hard to draw but the logic stays put. A nonzero determinant means the machine loses no information, and the system Ax = b has exactly one answer for each b.
What a zero determinant means in economics
When det A = 0 the model is in trouble. Suppose two equations for market equilibrium turn out to be multiples of each other. Then either they conflict, with no equilibrium, or they repeat, with a whole line of equilibria. Either way the model fails to determine the prices. When economists derive comparative statics results they divide by a determinant; the requirement that it be nonzero is exactly the condition for a clean answer.
Two further uses. In optimization, the sign of certain determinants (built from second derivatives) tells you whether a point is a maximum, a topic from Second-Order Conditions, Concavity and Convexity. And in input-output models, the system for total output is solvable only if a certain determinant is nonzero, which says the economy is productive enough to cover its own inputs.
A common mistake: the wrong formula or the wrong side
A frequent slip is to invert a matrix entry by entry, taking 1/2, 1/1, 1/1, 1/3. That is wrong. The inverse of Maya's matrix is not (1/2, 1; 1, 1/3). Use the recipe: swap, flip, divide by the determinant.
Another is to forget the sign changes: the off-diagonal entries get opposite signs, the diagonal ones swap places without a sign change.
A third is applying A⁻¹b as bA⁻¹. Matrix order matters, and the inverse multiplies from the left.
Finally, never "divide by a matrix." You multiply by an inverse, and only when the determinant is nonzero. If det A = 0, stop: no inverse exists and the answer is either none or many.
Words to know
Determinant a single number computed from a square matrix that is zero exactly when the matrix cannot be inverted.
Inverse matrix the matrix A⁻¹ such that A × A⁻¹ = I, which undoes what A does.
Singular matrix a square matrix with determinant zero, which has no inverse.
Cramer's rule a formula giving each unknown as the determinant of A with one column replaced by b, divided by det A.
Cofactor expansion computing a bigger determinant by working along a row using smaller determinants.
Independent rows rows where none can be built from the others by scaling and adding.
Identity matrix the matrix I with 1s on the diagonal that leaves any matrix unchanged when multiplied.
Check yourself
- Compute the determinant of the matrix with rows (4, 3) and (2, 5). Does the inverse exist?
- Find the inverse of the matrix with rows (4, 3) and (2, 5).
- Use that inverse to solve 4x + 3y = 18 and 2x + 5y = 16.
- Use Cramer's rule to find x in the same system and compare.
- Why does the matrix with rows (3, 6) and (1, 2) have no inverse?
- Explain in a sentence why x = A⁻¹b solves Ax = b, and why the inverse must go on the left.
Show the answers
- 4 × 5 − 3 × 2 = 20 − 6 = 14, which is not zero, so the inverse exists.
- Swap the diagonal, flip signs of the others, divide by 14: A⁻¹ = (1/14) × rows (5, −3) and (−2, 4).
- x = (5 × 18 − 3 × 16)/14 = (90 − 48)/14 = 3, and y = (−2 × 18 + 4 × 16)/14 = (−36 + 64)/14 = 2. Check: 12 + 6 = 18 and 6 + 10 = 16.
- Replace column 1 with b = (18, 16): determinant 18 × 5 − 3 × 16 = 90 − 48 = 42, and 42/14 = 3, the same x.
- The determinant is 3 × 2 − 6 × 1 = 0, so the matrix is singular; the first row is 3 times the second.
- Multiplying both sides of Ax = b on the left by A⁻¹ turns A⁻¹A into I, leaving x = A⁻¹b; on the right the product would not cancel because matrix multiplication depends on order.