A7 · Lesson 31 · Cofactors and Cramer's rule
Determinants by formula, and what they're good for
Numerical software never uses Cramer's rule; elimination is far faster. Yet engineers reach for it constantly, because it gives answers as formulas. Want to know how a sensor bridge's output depends on each resistor, symbolically, so you can see which one matters most? Cramer's rule writes the answer as a ratio of two determinants you can expand by hand. This lesson gives the determinant's rules, the cofactor formula, and Cramer's rule.
- The columns and are fixed. Move the target .
- Cramer's rule says is the area of the parallelogram from and , divided by the area from and . The dashed arrows show landing on .
- Put along . What is , and why does Cramer's rule agree?
Predict
You swap two rows of a matrix. What happens to its determinant?
It changes sign. Swapping rows reverses the orientation of the shape the rows (or columns) span, like looking at it in a mirror: the area or volume is the same, but its sign flips. That's why a matrix with two equal rows has determinant zero: swapping them changes nothing, yet must flip the sign.
Name it
The rules
The determinant is the signed volume factor of the transformation. Three rules define it:
- .
- Swapping two rows changes the sign.
- It's linear in each row separately (scale a row by and the determinant scales by ).
Everything else follows:
- Two equal rows, or a zero row: .
- Subtracting a multiple of one row from another leaves unchanged, so elimination preserves it.
- , the sign set by the number of row swaps.
- , , .
- For an matrix, .
Cofactor expansion
Along row : , where the cofactor and deletes row and column . The signs follow a checkerboard, . Expand along a row or column with many zeros.
Cramer's rule and the inverse
For with :
where is with column replaced by . Likewise , which for 2 × 2 is the swap-and-negate formula from lesson 11.
Cramer's rule costs roughly operations if the determinants are expanded by cofactors, hopeless beyond a few unknowns. Use it for formulas, not for numbers.
Worked example
Find by cofactors.
Show the solution
- Expand along row 1.
- Evaluate the 2 × 2 determinants and add.
Answer the determinant is 5.
Worked example
Current is injected into node 1 of a two-node network with conductances (node 1 to ground), (between the nodes) and (node 2 to ground). Find as a formula.
Show the solution
- Matrix and source vector. and .
- Cramer's rule. Replace column 2 with :
- What the formula shows. It shows at once that as (the nodes come apart), something a number alone wouldn't.
Answer .
Worked example
Find the determinant of the matrix with 2 on the diagonal and beside it, for up to 5.
Show the solution
- Expand along the first row. The 2 multiplies the same matrix one size smaller, .
- The 's cofactor. Expanded down its first column, it leaves . So
- Run the recurrence. Starting from and : In general .
- What it means. This matrix is the conductance matrix of a ladder of equal resistors, so it's never singular.
Answer the determinants are 2, 3, 4, 5 and 6 for = 1 to 5, and in general .
Check
Expand by cofactors.
Check
= −3. Two rows of are swapped. What is the new determinant?
Check
is 3 × 3 with = −2. What is ?
Check
= 2 and = 3. What is ?
Check
Use Cramer's rule on . What is ?
Check
A two-node network has = 1 mS (node 1 to ground), = 0.5 mS (between the nodes) and = 4 mS (node 2 to ground). 2 mA is injected into node 1. What is ?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
Take .
(a)
What is ?
(b)
By Cramer's rule, what is in ?
Check
Solve by Cramer's rule.
Step 1
What is the determinant?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is ?
Explain why
Why is ?
The determinant is the factor by which a matrix scales signed areas or volumes. Applying means applying first, which scales every area by , then , which scales the result by . The combined effect scales areas by the product. Since is defined as exactly that combined scale factor, it equals .
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.