Cofactor Expansion Calculator

Enter your square matrix values and matrix size to compute the determinant via Laplace's cofactor expansion. Set the matrix size (2×2 up to 5×5), fill in each cell value, and get the determinant along with a breakdown of the cofactor terms used in the expansion.

Select the size of your square matrix.

Choose the row or column to expand along. Rows/columns with more zeros speed up calculation.

Results

Determinant

--

Matrix Size

--

Cofactor Terms in Expansion

--

Matrix Invertible?

--

Cofactor Term Contributions

Results Table

Frequently Asked Questions

What is cofactor expansion?

Cofactor expansion (also called Laplace expansion) is a method of computing the determinant of a square matrix by breaking it down recursively. You pick any row or column, then sum the products of each element with its corresponding cofactor. The cofactor of element (i,j) is (−1)^(i+j) times the determinant of the submatrix formed by deleting row i and column j.

How do you find the determinant by cofactor expansion?

Choose any row or column of your matrix. For each element in that row or column, multiply the element by (−1)^(i+j) and by the determinant of the minor (the smaller matrix obtained by removing that element's row and column). Sum all these products together to get the determinant. This process repeats recursively until you reach 2×2 submatrices, whose determinants are computed directly as ad−bc.

What row or column should I choose in cofactor expansion?

You can choose any row or column — the determinant will be the same regardless. For efficiency, pick the row or column that contains the most zeros, since each zero element contributes nothing to the sum and eliminates one recursive subproblem entirely, saving computation time.

How do I compute a cofactor?

The cofactor C(i,j) of element at row i, column j is computed as (−1)^(i+j) × M(i,j), where M(i,j) is the minor — the determinant of the submatrix formed by deleting row i and column j from the original matrix. The sign alternates in a checkerboard pattern: positive for (i+j) even, negative for (i+j) odd.

How do I compute the cofactor expansion for a 3×3 matrix?

For a 3×3 matrix, expand along the first row: det = a11·C11 + a12·C12 + a13·C13. Each cofactor C1j involves a 2×2 minor whose determinant is straightforward. For example, C11 = (+1)·(a22·a33 − a23·a32), C12 = (−1)·(a21·a33 − a23·a31), and C13 = (+1)·(a21·a32 − a22·a31).

Does it matter which row or column I expand along?

No — the value of the determinant is always the same regardless of which row or column you choose for cofactor expansion. This is guaranteed by the properties of determinants. However, the amount of arithmetic work varies, so choosing a row or column with many zeros makes computation much faster.

What does a determinant of zero mean?

A determinant of zero means the matrix is singular — it has no inverse. Geometrically, it means the rows (or columns) of the matrix are linearly dependent, and the matrix maps space to a lower-dimensional subspace. In practical terms, a system of linear equations with a singular coefficient matrix either has no solution or infinitely many solutions.

Can cofactor expansion be used for matrices larger than 5×5?

Yes, cofactor expansion works for any square matrix of any size, but it becomes computationally expensive very quickly. The number of operations grows as n! (factorial), so for large matrices (e.g. 10×10 or bigger), other methods like LU decomposition or Gaussian elimination are far more efficient. Cofactor expansion is best suited for matrices up to about 5×5 or for deriving theoretical results.

More Math Tools