Cofactor Expansion Calculator
Calculate matrix determinants using cofactor (Laplace) expansion along any row or column with full step-by-step solution.
About
The cofactor expansion method (Laplace expansion) computes the determinant of an n ร n matrix by reducing it to a weighted sum of (n โ 1) ร (n โ 1) minor determinants. Each element aij is multiplied by its cofactor Cij = (โ1)i+j โ Mij, where Mij is the determinant of the submatrix formed by deleting row i and column j. Manual expansion on matrices larger than 3 ร 3 is error-prone. A single sign mistake in the checkerboard pattern propagates through every subsequent minor. This tool traces every recursive step so you can verify intermediate results against your own work.
The calculator supports expansion along any row or column. Choosing a row or column with zeros reduces computation since terms with aij = 0 contribute nothing. The tool approximates results assuming exact rational input. Floating-point entries may introduce rounding in deeply nested expansions beyond 5 ร 5.
Formulas
The Laplace expansion of the determinant along row i of an n ร n matrix A:
where the cofactor Cij is defined as:
and Mij is the minor determinant obtained by deleting row i and column j from A. The base case for a 2 ร 2 matrix:
For a 1 ร 1 matrix, det([a]) = a.
Where: aij = element at row i, column j. Cij = cofactor of element (i, j). Mij = minor determinant (submatrix determinant). n = matrix dimension.
Reference Data
| Matrix Size | Terms in Expansion | Total Multiplications | Minor Size | Recommended Strategy |
|---|---|---|---|---|
| 2 ร 2 | 2 | 2 | 1 ร 1 | Direct formula ad โ bc |
| 3 ร 3 | 3 | 12 | 2 ร 2 | Expand along row/column with zeros |
| 4 ร 4 | 4 | 64 | 3 ร 3 | Row reduce first if possible |
| 5 ร 5 | 5 | 320 | 4 ร 4 | Combine with row operations |
| 6 ร 6 | 6 | 1920 | 5 ร 5 | Use LU decomposition for speed |
| Cofactor Sign Pattern (Checkerboard) | ||||
| + | โ | + | โ | + |
| โ | + | โ | + | โ |
| + | โ | + | โ | + |
| โ | + | โ | + | โ |
| + | โ | + | โ | + |
| Key Properties of Determinants | ||||
| Swapping two rows | Multiplies determinant by โ1 | |||
| Scaling a row by k | Multiplies determinant by k | |||
| Adding row multiple to another | Determinant unchanged | |||
| Two identical rows | det(A) = 0 | |||
| Triangular matrix | Product of diagonal entries | |||
| det(AT) | = det(A) | |||
| det(AB) | = det(A) โ det(B) | |||
| det(Aโ1) | = 1 รท det(A) | |||
| det(kA) for nรn | = kn โ det(A) | |||