For the 3-by-3 matrix M as above, C12=(M21M23M31M33) .
28. Cofactor expansion
28. Cofactor expansion
Recall that the determinant of a 3-by-3 matrix M=(M11M12M13M21M22M23M31M32M33) is M11M22M33-M11M23M32-M12M21M33+M12M23M31+M13M21M32-M13M22M31. We can group these into three sets of terms according to the factor M1k : those which contain a factor of M11 , those with an M12 and those with an M13 : M11(M22M33-M23M32)-M12(M21M33-M23M31)+M13(M21M32-M22M31). Note that the terms in brackets are themselves determinants of 2-by-2 submatrices: M11det(M22M23M32M33)-M12det(M21M23M31M33)+M13det(M21M22M31M32). When we group our determinant according to the choice of the factor M1k , the expansion we get is: det(M)=M11det(C11)-M12det(C12)+M13det(C13)-⋯±M1ndet(C1n). Here:
-
signs alternate; in particular, the last ± is + if n is odd and - if n is even.
-
Cij is the submatrix of M obtained by removing the i th row and the j th column. For example, C22=(M11XM13XXXM31XM33)=(M11M13M31M33) (where the X s show which columns/rows we have removed).
This makes sense: if you pick Mij then you can't pick anything else from row i or from column j .
More generally, we could group terms according to the choice of factor M2k , or M3k , or any other row. The result of expanding about row i would have been: det(M)=±Mi1det(Ci1)∓Mi2det(Ci2)±⋯, where the signs alternate (I'll talk more about exactly which signs occur below).
Or we could group terms according to the choice of entry in column 1, or column 2, etc. The result of expanding down column j would have been det(M)=±M1jdet(C1j)∓M2jdet(C2j)±⋯ where the signs alternate.
Signs
The sign you put in front of Mijdet(Cij) is the ij th entry of this matrix: (+-+-⋯-+-+⋯+-+-⋯-+-+⋯⋮⋮⋮⋮⋱) For example, expanding a 3-by-3 matrix down column 2 would give -M12det(C12)+M22det(C22)-M32det(C32).
Examples
Rather than prove any of these formulae, which would be painful for everybody, let's do some examples.
Let's compute the determinant of A=(123456789) using the cofactor expansion along the first row: det(A)=1×det(5689)-2det(4679)+3det(4578) =5×9-6×8-2(4×9-6×7)+3(4×8-5×7) =45-48-2(36-42)+3(32-35) =-3+12-9 =0.
Just for comparison, let's expand down the first column (I said row in the video): det(A)=1det(5689)-4det(2389)+7det(2356) =-3-4(18-24)+7(12-15) =-3+24-21 =0. Which, reassuringly, gives the same answer.
Let's calculate the determinant of B=(11230045-12110023) Expanding along the top row would give us four terms to calculate. If instead we expand around the first or second columns or the second or fourth rows, then we only have two terms to calculate. Let's do the second column (because the signs will be more fun that way).
We get: det(B)=-1det(045-111023)-2det(123045023) (care with signs!). For the first 3-by-3 submatrix (C12 ) we have (expanding down the first column): det(045-111023)=-(-1)(4×3-5×2)=2 For the second, we get (expanding down the first column): det(123045023)=4×3-5×2=2, so overall we get det(B)=-1×2-2×2=-6.
As a final sanity check, let's compute this again using row operations. If we do R3↦R3+R1 , then B becomes (1123004503340023). Now we switch R2↔R3 and then R3↔R4 (so the original row 2 ends up at the bottom) to get: (1123033400230045). Finally R4↦R4-2R3 yields: (112303340023000-1). This is in echelon form. We did two row-switches, so the determinant changed sign twice (i.e. didn't change sign overall), so that det(B) is just the product of the diagonal entries in this echelon matrix. In other words, det(B)=1×3×2×(-1)=-6, which agrees with the previous example.