MatrixCalc

Characteristic polynomial calculator

Compute det(A − λI) for any square matrix and get the characteristic polynomial in expanded form — the equation whose roots are the eigenvalues.

Matrix A
rows: 3
cols: 3
Matrix B
rows: 3
cols: 3
Operations

Open the steps below to see the full answer.

Result
Pick an operation to see the result here. Errors will show up in this area.

Tips: adjust sizes (max 50×50). For A×B, cols(A)=rows(B). det/inverse/trace/power require square matrices.

React, Tailwind & shadcn/ui. No external math deps. — English

The characteristic polynomial of A is det(A − λI), written out as a polynomial in λ. Press Char. polynomial(A) and open the steps to see the coefficients. Its roots are exactly the eigenvalues, which is where every hand computation of eigenvalues begins.

Where it comes from

The defining equation A·v = λ·v rearranges to (A − λI)·v = 0. A non-zero v can only solve that if A − λI is singular — otherwise the only solution is v = 0 — and a matrix is singular exactly when its determinant vanishes. So the eigenvalues are the values of λ making det(A − λI) = 0, and that expression is the characteristic polynomial.

For an n×n matrix the result has degree n, and two of its coefficients can be read off the matrix without any expansion at all: the coefficient just below the leading term is the negative of the trace, and the constant term is the determinant up to a sign of (−1)ⁿ. Both make excellent checks on a hand computation.

Worked example

21
12
→ det
2 − λ1
12 − λ
= λ² − 4λ + 3 = (λ − 1)(λ − 3)

The roots 1 and 3 are the eigenvalues. Note the checks: the trace is 4 and the λ coefficient is −4; the determinant is 3 and so is the constant term. The calculator uses the Faddeev–LeVerrier recurrence, which builds the coefficients from traces of successive powers and stays exact instead of expanding a symbolic determinant.

Common mistakes

  • Subtracting λ from every entry. λI is λ on the diagonal and zero elsewhere, so only the diagonal changes.
  • Losing the sign convention. det(A − λI) and det(λI − A) differ by (−1)ⁿ. Both are used; pick one and stay with it.
  • Reading multiplicity as a count of eigenvectors. A double root need not bring two independent eigenvectors — when it does not, the matrix is defective.
  • Expecting real roots. A real matrix can have a characteristic polynomial with complex roots, and then its eigenvalues are complex.

Frequently asked questions

What is the characteristic polynomial used for?
Its roots are the eigenvalues of the matrix, so it is the bridge between a matrix and its spectrum. It also appears in the Cayley-Hamilton theorem, which says every matrix satisfies its own characteristic equation.
What degree will the polynomial have?
The same as the size of the matrix: an n×n matrix gives a polynomial of degree n, and therefore n eigenvalues counted with multiplicity.
How do the trace and determinant appear in it?
For an n×n matrix, the coefficient of λ^(n−1) is the negative of the trace, and the constant term is the determinant times (−1)^n. Both are quick sanity checks.
Should I use it to find eigenvalues numerically?
Not for large matrices. Polynomial roots are extremely sensitive to coefficient error, so numerical libraries work on the matrix directly with QR iteration. For hand computation up to 3×3 the polynomial is the right tool.

Want the full explanation? Read the guide: How to calculate the determinant of a matrix

Other calculators