Matrix Determinant
calculator.
Find the determinant of a square matrix by cofactor expansion or by row reduction.
- Verdict
- Invertible
- Trace
- 7
- Expanded along
- row 2
A is invertible. As a map it scales every volume by 49 and keeps orientation.
How the terms add up
a₂₁C₂₁ = 38, a₂₂C₂₂ = 0, a₂₃C₂₃ = 11. They add up to det(A) = 49.
Working
- 1Expand along row 2det(A) = a₂₁C₂₁ + a₂₂C₂₂ + a₂₃C₂₃This row has 1 zero entry, and a zero entry needs no minor. Each cofactor is the minor’s determinant with the sign + or − from a checkerboard that starts with + top left.
- 2Minus a₂₁ times the determinant of its minorM₂₁ =−(2)(−19)=38
- 3a₂₂ is 0This term is 0, so its minor is skipped.
- 4Minus a₂₃ times the determinant of its minorM₂₃ =−(−1)(11)=11
- 5Add the termsdet(A) =(38)+(0)+(11)=49
- 6Check: row reduction gives the same numberPivots multiplied, with a sign flip per swap:49
Expansion along row 2
| Entry | Minor | Cofactor | Term |
|---|---|---|---|
| a₂₁ =2 | −19 | 19Minor det −19 | 38 |
| a₂₂ =0 | 9 | 9Minor det 9 | 0 |
| a₂₃ =−1 | 11 | −11Minor det 11 | 11 |
The cofactor is the minor’s determinant with its checkerboard sign. Each term is the entry times its cofactor, and the terms add up to det(A).
Type or paste a matrix
How it's worked out
The determinant is one number worked out from a square matrix. For a 2 by 2 matrix it is the product down the main diagonal minus the product down the other diagonal.
Cofactor expansion handles larger matrices. Pick a row or a column. Each entry in it gets a minor, which is the smaller matrix left when you cross out that entry's row and column. The cofactor is the minor's determinant with a sign from a checkerboard pattern that starts with plus in the top left corner. Multiply each entry by its cofactor and add the results.
Interactive Linear Algebra states that every row and every column gives the same number. So the tool expands along the line with the most zeros, since a zero entry needs no minor at all.
Row reduction is the second route. Adding a multiple of one row to another leaves the determinant alone, and each row swap flips its sign. Once the matrix is triangular, the determinant is the product of the diagonal, with one sign flip per swap. Each method is checked against the other in the last step.
Worked examples
Maya expands a 3 by 3 matrix along its zero
Maya has this matrix in her homework and wants to check her answer before she hands it in.
Row 2 holds a 0, so she expands along it and needs only two minors. The signs in row 2 run minus, plus, minus. The first term is , the middle term is 0, and the last is .
If she had expanded along row 1 instead, she would have worked out three minors and still reached 49.
Jon finds the determinant by row reduction
Jon's course asks for row reduction, not expansion.
Adding 2 times row 1 to row 2 and row 1 to row 3 clears column 1. That leaves a 0 in the second pivot spot, so he swaps rows 2 and 3, which flips the sign once. The triangular form has 1, 3, −5 on its diagonal.
Cofactor expansion gives 15 as well. Forgetting the swap is the slip that gives −15.
Priya tests a matrix for an inverse
Priya needs to know if this matrix can be inverted before she tries.
Row 3 minus row 2 equals row 2 minus row 1, so the rows depend on each other. Expansion along row 1 gives terms −3, 12, −9, which cancel to 0. The matrix is singular, so it has no inverse and she can stop there.
Reading your result
Zero or not zero. A square matrix has an inverse exactly when its determinant is not 0, as Interactive Linear Algebra section 4.1 puts it. A zero also tells you that Ax = b has either no solution or infinitely many.
The size is a scale factor. By section 4.3, the absolute value is the area of the parallelogram the columns of a 2 by 2 matrix span, or the volume of the box for a 3 by 3. For the matrix with rows 3, 8 and 4, 6 the determinant is −14, so it stretches every area by 14. Swapping its rows gives 14, the same size with the other sign.
The sign is orientation. A negative determinant means the map flips space, like a mirror. For 2 by 2, it means column 2 sits clockwise from column 1.
Row operations have set effects. The table applies each one to the matrix with rows 1, 2 and 3, 4, whose determinant is −2.
| Change | New det | Effect |
|---|---|---|
| Swap the two rows | 2 | Sign flips |
| Multiply row 1 by 3 | −6 | Times 3 |
| Add 2 × row 1 to row 2 | −2 | No change |
| Transpose | −2 | No change |
Two more rules help as checks: det(AB) is det(A) times det(B), and det of the inverse is 1 over det(A). Scaling a whole n by n matrix by k scales the determinant by k to the power n, so doubling a 2 by 2 matrix takes −2 to −8.
Common mistakes
- Dropping the checkerboard sign. The signs depend on where the entry sits, not on the entry. Row 2 of a 3 by 3 matrix starts with minus.
- Losing count of swaps. Every row swap flips the sign, so an even number of swaps leaves the sign alone and an odd number flips it.
- Expanding along row 1 out of habit. It is never wrong, but it can be slow. In the matrix with rows 1, 5, 0 and 2, 4, −1 and 0, −2, 0, row 3 has two zeros, so expanding along it needs one minor and gives −2 at once.
- Scaling a row and not undoing it. Dividing a row by 2 to get a 1 halves the determinant, so multiply back by 2 at the end.
- Using the diagonal rule on a 4 by 4. The shortcut of diagonal products works for 3 by 3 only. Larger matrices need expansion or row reduction.