Determinant: cofactor expansion and computing with row operations
You learn the minor and cofactor, cofactor expansion along any row or column, the triangular matrix rule, and how row operations change the determinant, so you can compute 3×3 and 4×4 determinants without a calculator.
The determinant assigns a single number to a square matrix, and that number says a lot about the matrix: if it is zero the matrix is singular, the system does not have a unique solution, the columns are dependent. This week we learn to compute the number; next week its properties and uses (Cramer, adjoint). The problem book’s favorite method is reducing to triangular form with row operations, so the emphasis is there.
Golden rules:
When expanding by cofactors, choose the row or column with the most zeros.
Draw the sign table in the corner of the page: + at the top left, then a checkerboard.
In row operations, prefer Ri←Ri+cRj. It does not change the determinant.
If you swapped rows, track (−1); if you multiplied a row by c, track the factor c.
2×2 and 3×3 determinants
det[acbd]=acbd=ad−bc.
detA and ∣A∣ are two ways of writing the same thing. (∣A∣ here is not an absolute value; a determinant can be negative.)
Minor and cofactor
For an n×n matrix A:
The minorMij: the determinant of the (n−1)×(n−1) matrix that remains when row i and column j are deleted from A.
The cofactorCij=(−1)i+jMij.
The sign (−1)i+j gives a checkerboard pattern:
+−+−−+−++−+−−+−+
Cofactor expansion
The determinant can be expanded along any row or column and always gives the same result:
Since the term of a zero entry is zero anyway, choosing the row with the most zeros shortens the work.
Example 1.A=21−2−105341. There is a zero in column 2, so let us expand there. The signs for column 2 are −,+,−.
C12 = (-1)^(1+2) · det[1 4; -2 1] = -(1 + 8) = -9C22 = its factor a22 = 0, no need to computeC32 = (-1)^(3+2) · det[2 3; 1 4] = -(8 - 3) = -5det A = (-1)(-9) + 0 + (5)(-5) = 9 - 25 = -16
Sarrus’ rule (only 3×3). Rewrite the first two columns to the right. Add the products of the three downward diagonals and subtract the products of the three upward ones. For the same matrix: down 0+8+15=23, up 0+40−1=39, det=23−39=−16. Sarrus’ rule does not work for 4×4.
Row 3 has only one entry (a33=4, sign +). We expanded the remaining 3×3 along row 1: only 1⋅(1⋅3−2⋅0)=3.
Triangular matrices
The determinant of an upper triangular, lower triangular or diagonal matrix is the product of the diagonal entries:
det2005−30−146=2⋅(−3)⋅6=−36.
Why? If you expand along the first column, only a11 remains, and the remaining matrix is triangular too; repeat. This rule is the basis of the next method.
Determinant with row operations
Cofactor expansion needs about n! multiplications for n×n; it is laborious for 4×4 and a nightmare for 5×5. A better way: make the matrix triangular with row operations, multiply the diagonal, and account for the effect of the operations you did.
Operation
Effect on the determinant
How to remember
Ri↔Rj
×(−1)
every swap flips the sign
Ri←cRi
×c
a common factor comes out of a row
Ri←Ri+cRj
unchanged
the safest operation
In practice it is more natural to think of taking out a common factor from a row: 2143=21123.
Example 3.detA, A=21034316−202164110.
Take 2 out of row 1: detA=2detA′, where row 1 of A′ is (1,2,−1,3). Then only addition operations:
The product of the diagonal is 1. With the 2 we took out at the start: detA=2⋅1=2.
PITFALL · “I reduced it to I, so det = 1”. Reducing A to I does not make detA=1. Along the way, every swap leaves a (−1) and every scaling c1Ri leaves a factor c. Collect them all, then decide.
PITFALL · mixed operations. Written in one step, R2←3R2−R1 looks innocent, but it hides R2←3R2: the determinant is multiplied by 3. Harmless in systems, an error in determinants.
Column operations
Since detAT=detA (next week), the three rules above apply to columns as well. If one column is a multiple of another, the determinant is 0; swapping two columns flips the sign.
Quick signs that the determinant is zero
Situations that let you say detA=0 without computing:
What you see
Why
A zero row or zero column
expanding along it, every term is 0
Two equal rows
after swapping the matrix is the same but det must change sign: d=−d⇒d=0
One row is a multiple of another
an addition produces a zero row
One row is a combination of the others
likewise a zero row
Example: in 14−2−20435−6, row 3 =−2× row 1, so the determinant is 0 (Q9).
Parametric determinants
Questions like “find the values of t for which det=0” serve two purposes: finding singularity (week 5) and finding eigenvalues (week 13, the same calculation det(A−λI)=0). Method: catch a common factor with row operations and keep the factored form.
Then R2←R2−R1, R3←R3−R1: the diagonal is 1,t−1,t−1. The result is (t+2)(t−1)2. Much shorter than expanding everything and solving a cubic polynomial.
Common mistakes
Wrong
Right
Taking the sign of C12 and C21 as +
(−1)1+2=−1
Forgetting to multiply by aij in the cofactor expansion
The term is aijCij
Using Sarrus’ rule for 4×4
Only for 3×3
Not flipping the sign when swapping rows
Every swap is ×(−1)
Forgetting c after Ri←cRi
det(new)=c⋅det(old)
Reducing to I and saying “det = 1”
Track the factors of the operations
Doing (−2)⋅(−3) in your head and losing a sign
Write it with parentheses on paper
Thinking $
A
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
Question 1easy
Compute det[34−25].
Show answer
23
ad−bc=3⋅5−(−2)⋅4=15+8=23. Minus times minus: −(−8)=+8. Write it with parentheses.
Question 2easy
Let A=1354−12206. Find the minor M23 and the cofactor C23.
Show answer
M23=−18,C23=18
M23: delete row 2 and column 3, what remains is [1542]. det=2−20=−18.C23=(−1)2+3M23=−(−18)=18.
Question 3medium
Use cofactor expansion along the best row or column to compute det231040105.
Show answer
36
Column 2 has only one nonzero entry: a22=4, with sign (−1)2+2=+.det=4⋅det[2115]=4(10−1)=36.
Question 4medium
Use row operations to compute det12−1371234.
Show answer
10
Use only the addition operation (Ri←Ri+cRj), the determinant does not change.R2←R2−2R1: (0,1,−1). R3←R3+R1: (0,4,6). R3←R3−4R2: (0,0,10). Upper triangular: det=1⋅1⋅10=10.
Question 5easy
Compute det20005−300−14107164.
Show answer
-24
Upper triangular matrix: the determinant is the product of the diagonal. 2⋅(−3)⋅1⋅4=−24. The numbers above the diagonal do not matter at all.
Question 6medium
Use row operations to compute det1210253113320124.
Show answer
2
R2←R2−2R1: (0,1,1,1). R3←R3−R1: (0,1,2,2).R3←R3−R2: (0,0,1,1). R4←R4−R2: (0,0,1,3). R4←R4−R3: (0,0,0,2). All are addition operations. Diagonal: 1⋅1⋅1⋅2=2.
Question 7medium
A is 3×3 with detA=5. B is obtained from A by R1↔R2, then R3←4R3, then R2←R2+7R1. Find detB.
Find all values of t for which dett111t111t=0.
Show answer
t=1 or t=−2
R1←R1+R2+R3 (two additions, det unchanged): (t+2,t+2,t+2). Factor (t+2) out of the row: (1,1,1). Then R2←R2−R1: (0,t−1,0), R3←R3−R1: (0,0,t−1).det=(t+2)⋅1⋅(t−1)(t−1)=(t−1)2(t+2). Check t=0: (1)(2)=2; directly 0−1(0−1)+1(1−0)=2.
Question 9easy
Without expanding, find det14−2−20435−6.
Show answer
0
Row 3 =−2× row 1. R3←R3+2R1 produces a zero row, the determinant does not change, and a matrix with a zero row has determinant 0.
The first two rows are swapped: ×(−1). Row 3 is multiplied by 2: ×2.3⋅(−1)⋅2=−6.
Question 11hard
Compute det1241391525.
Show answer
6
R2←R2−2R1: (0,1,3). R3←R3−4R1: (0,5,21). R3←R3−5R2: (0,0,6).det=1⋅1⋅6=6. This is a Vandermonde determinant: (3−2)(5−2)(5−3)=6.
Question 12medium
Solve det[x−2−51x+4]=0.
Show answer
x=1 or x=−3
(x−2)(x+4)−(1)(−5)=x2+2x−8+5=x2+2x−3=(x+3)(x−1). The roots are x=1, x=−3.
Verification: All determinants were computed in node by exact elimination with BigInt fractions; the minors and cofactors were checked separately, and the row-operation traces were applied step by step; the parametric determinant was compared with the factored formula at many values of t (verify/MAT1041/04.mjs).
Review card
2×2: det = ad - bc.
M_ij = the det of what remains after deleting row i and column j. C_ij = (-1)^(i+j) M_ij.
Sign table: + - + / - + - / + - + (a12, a21 are minus!)
Cofactor expansion: along any row/column: det = Σ a_ij C_ij. Choose the one with the MOST ZEROS.
Sarrus (ONLY 3×3): 3 down diagonals (+), 3 up diagonals (-).
Triangular/diagonal matrix: det = product of the diagonal.
Effect of row operations:
Ri ↔ Rj → × (-1)
Ri ← cRi → × c (c factors out of the row)
Ri ← Ri + cRj → unchanged (safest)
Ri ← 3Ri - Rj → × 3 (mixed operation, careful)
Zero row/column, two equal or proportional rows → det = 0.
The same rules hold for COLUMNS.
Strategy: make it triangular using additions, multiply the diagonal, account for swaps and scalings.