← STEM Learning Studio
Determinant, trace & inverse via cofactor expansion

Matrix Determinant & Inverse Calculator

Enter a 2×2 or 3×3 matrix to find its determinant, trace, and inverse (when it exists) — the linear-algebra machinery behind structural stiffness matrices, circuit-analysis mesh equations, and systems of linear equations.

Matrix entries
Determinant
-6
Non-singular — inverse exists
Trace
7
sum of the main diagonal
Inverse matrix A⁻¹
-0.5
0.5
1
-0.6667

About the Matrix Determinant & Inverse Calculator

A matrix's determinant tells you whether it can be inverted at all, and its inverse is the tool that lets you solve a system of linear equations directly — the same operation that underlies structural stiffness analysis, circuit mesh/node equations, and control-system state-space models. This calculator handles both 2×2 and 3×3 matrices and shows the cofactor expansion used to build the inverse.

The 2×2 determinant and inverse

For a 2×2 matrix [[a, b], [c, d]], the determinant is det(A) = ad − bc. If det(A) ≠ 0, the inverse has a simple closed form: A⁻¹ = (1/det(A)) · [[d, −b], [−c, a]] — swap the diagonal entries, negate the off-diagonal entries, and divide by the determinant.

The 3×3 determinant by cofactor expansion

For a 3×3 matrix, this calculator expands along the first row: det(A) = a·C₁₁ + b·C₁₂ + c·C₁₃, where each Cᵢⱼ is a cofactor — a signed 2×2 determinant formed by deleting row i and column j. Concretely, for A = [[a,b,c],[d,e,f],[g,h,i]]: C₁₁ = ei − fh, C₁₂ = −(di − fg), C₁₃ = dh − eg.

Building the inverse from cofactors

The full 3×3 inverse is A⁻¹ = (1/det(A))·adj(A), where the adjugate adj(A) is the transpose of the complete matrix of cofactors (compute all nine Cᵢⱼ, then swap rows and columns). This calculator computes all nine cofactors internally and displays the resulting inverse directly.

Worked example (2×2)

Take A = [[4, 3], [6, 3]]. det(A) = (4)(3) − (3)(6) = 12 − 18 = −6, so the matrix is invertible. A⁻¹ = (1/−6)·[[3, −3], [−6, 4]] = [[−0.5, 0.5], [1, −0.667]]. Multiplying A by A⁻¹ returns the identity matrix, which is always a good way to check your work by hand.

Frequently asked questions

What does it mean if the determinant is zero?

A zero determinant means the matrix is singular — it has no inverse, and the system of linear equations it represents either has no solution or infinitely many. Geometrically, a singular 2×2 matrix collapses the plane onto a line (or a point), so the transformation cannot be undone.

What is the trace used for?

The trace (the sum of the diagonal entries) is invariant under a change of basis and equals the sum of a matrix's eigenvalues. It shows up in characteristic-polynomial calculations, stability analysis of dynamic systems, and as a quick sanity check when comparing matrices.

Why does the 3×3 inverse formula use cofactors instead of just dividing?

Matrix division is not defined the way scalar division is — you cannot simply divide by a matrix. Instead, the inverse is built from the adjugate (the transposed cofactor matrix) scaled by 1/det(A), which is the direct generalization of the 2×2 swap-and-negate pattern to larger matrices.

Where does this actually get used in engineering?

Solving a system of simultaneous equations — nodal circuit analysis, structural stiffness/flexibility methods, and multi-loop mass-spring systems — is equivalent to inverting a matrix. Software (and this calculator) automates the arithmetic, but understanding what the inverse represents is what lets you interpret the results.

Related tools & guides

Derivative & Limit EvaluatorBeam Reactions Calculator (Structural)Linear Algebra for Engineers GuideSTEM Exam Prep