Understanding the matrix determinant calculator — concept and principle
The determinant is a single number computed from a square matrix. It tells you whether the matrix can be inverted, how the linear transformation scales area or volume, and whether a system of linear equations has a unique solution. Enter a square matrix (rows separated by semicolons) to get its determinant, trace and invertibility. It is used in linear algebra, Cramer's rule and eigenvalue problems.
How it is calculated
- Gaussian (LU) elimination with partial pivoting reduces the matrix to upper-triangular form: in each column the row with the largest absolute pivot is moved up, and multiples of it are subtracted from the rows below.
- det(A) = (product of the pivots) × (−1)^(number of row swaps).
- Trace = sum of the diagonal entries a₁₁ + a₂₂ + … + aₙₙ.
- Invertible if |det(A)| > 10⁻¹², otherwise singular.
The principle
Three rules apply: adding a multiple of one row to another leaves the determinant unchanged, swapping two rows flips its sign, and a triangular matrix's determinant is the product of its diagonal. Elimination uses only the first two operations, so the determinant can be read off the triangular result. This takes about n³/3 operations, versus roughly n! for cofactor expansion. Partial pivoting avoids dividing by tiny numbers and keeps rounding errors small. Geometrically, |det A| is the factor by which A multiplies areas (2×2) or volumes (3×3); a negative sign means the transformation flips orientation.
Worked example
- Default matrix: rows (2, −1, 0), (1, 3, 2), (0, 1, 4).
- Column 1: the largest pivot is 2, already on top. Row 2 − 0.5 × row 1 gives (0, 3.5, 2); row 3 stays (0, 1, 4).
- Column 2: pivot 3.5 > 1, no swap. Row 3 − (1 ÷ 3.5) × row 2 gives (0, 0, 3.428571).
- det = 2 × 3.5 × 3.428571 = 24 (no swaps, so no sign change).
- Check by cofactors: 2(3·4 − 2·1) − (−1)(1·4 − 2·0) + 0 = 20 + 4 = 24.
- Trace = 2 + 3 + 4 = 9. Since 24 ≠ 0, invertible: yes.
How to read the result
det(A) = 0 means the rows are linearly dependent: the matrix has no inverse, and Ax = b has either no solution or infinitely many. A non-zero determinant guarantees a unique solution. Its size alone does not show how close A is to singular: scaling a 3×3 matrix by 10 multiplies det by 1,000. The trace equals the sum of the eigenvalues and the determinant equals their product.
Common mistakes
- Entering a non-square matrix; determinants exist only for n × n matrices.
- Forgetting to flip the sign after each row swap when working by hand.
- Assuming det(A + B) = det A + det B; only det(AB) = det A × det B holds.
Frequently asked questions
What is the shortcut for a 2×2 determinant?
For rows (a, b) and (c, d), det = ad − bc.
How does the determinant relate to the inverse?
A⁻¹ exists exactly when det A ≠ 0, and det(A⁻¹) = 1 ÷ det A. For the example, det(A⁻¹) = 1/24.
What is the determinant of the transpose?
The same: det(Aᵀ) = det A.
Sources: Gilbert Strang, Introduction to Linear Algebra, Chapter 5 (determinants) · Gene H. Golub and Charles F. Van Loan, Matrix Computations, chapter on Gaussian elimination with pivoting