How Cofactor Expansion works
Cofactor expansion (also called Laplace expansion) is the standard method for computing the determinant of a square matrix by breaking it down into smaller determinants. For a 3×3 matrix A with entries aij, expanding along row i gives:
det(A) = ai1Ci1 + ai2Ci2 + ai3Ci3
The same identity works down any column j: det(A) = a1jC1j + a2jC2j + a3jC3j. Every choice of row or column produces the identical determinant — that invariance is the content of the Laplace expansion theorem.
Formula and method
Each Cij is a cofactor: Cij = (−1)i+j × Mij, where Mij is the minor — the determinant of the 2×2 matrix left after deleting row i and column j from A. The sign (−1)i+j follows a checkerboard pattern (+, −, +, −, +, −, +, −, +) starting with + in the top-left cell. For a 2×2 matrix, the minor is simply the single remaining entry (a determinant of one number is that number itself), so M11 for the top-left deletion equals the product-difference of the other four entries, e.g. det [[p,q],[r,s]] = ps − qr.
Common sources of error
- Sign errors: forgetting the (−1)i+j alternating sign is the single most common mistake — write out the sign pattern before multiplying
- Wrong minor: double-check you deleted the correct row and column before computing the 2×2 minor determinant
- Row/column mix-up: aij means row i, column j — swapping the indices picks the wrong matrix entry
Checking your result
Because the determinant is the same no matter which row or column you expand along, the best sanity check is to expand a second time along a different row or column and confirm you get the same number. If the two expansions disagree, a sign or arithmetic slip happened in one of them. You can also check the extreme cases: if any row or column is all zeros, or two rows/columns are identical, the determinant must be exactly 0.
Applications
The determinant tells you whether a matrix is invertible (det ≠ 0) or singular (det = 0), which in turn determines whether a linear system Ax = b has a unique solution. Cofactor expansion also builds the adjugate matrix (the transpose of the cofactor matrix), which is used in the formula A-1 = (1/det(A)) × adj(A) for inverting a matrix by hand.