How the Cofactor Matrix Calculator works
This tool computes the full cofactor matrix of a 3×3 matrix A, along with the determinant (found by cofactor expansion) and the adjugate matrix. The cofactor matrix is the foundation of two classical results in linear algebra: the cofactor-expansion formula for the determinant, and the adjugate-based formula for the matrix inverse.
Formula and method
For each entry aij of A, first form the minor Mij — the determinant of the 2×2 matrix left after deleting row i and column j. The cofactor attaches a sign based on position:
Cij = (−1)i+j × Mij
The signs form a checkerboard pattern starting with + in the top-left corner: +, −, +, −, +, −, +, −, +. Collecting all nine cofactors gives the cofactor matrix C(A). Two further results follow directly from it: the determinant is a weighted sum of any row's entries and their cofactors — det(A) = a₁₁C₁₁ + a₁₂C₁₂ + a₁₃C₁₃ when expanding along row 1 — and the adjugate adj(A) is simply the transpose of C(A), which in turn gives the inverse: A⁻¹ = adj(A) / det(A) whenever det(A) ≠ 0.
Common sources of error
- Missing the sign: forgetting the (−1)i+j factor turns a cofactor into a plain minor — always check the checkerboard sign pattern for the entry's row and column.
- Mixing up rows and columns: Mij deletes row i and column j, not row j and column i — a swapped index produces the transpose of the correct minor.
- Confusing cofactor matrix with adjugate: the adjugate is the transpose of the cofactor matrix, C(A)ᵀ, not C(A) itself — they only coincide when C(A) is symmetric.
Checking your result
Cofactor expansion works along any row or column, so pick a second one and confirm you get the same determinant — for example, expand along column 1 (a₁₁C₁₁ + a₂₁C₂₁ + a₃₁C₃₁) and check it matches the row-1 expansion. If det(A) ≠ 0, you can also verify A × adj(A) equals det(A) times the identity matrix.
Applications
The cofactor matrix underlies Cramer's rule for solving linear systems, the adjugate-based inverse formula (useful for exact, fraction-free computation before dividing by the determinant), and symbolic computer algebra systems that need an inverse without introducing rounding error early. It generalizes the same idea used for 2×2 matrices, where the cofactor matrix reduces to just swapping and negating two entries.