Understanding the characteristic polynomial calculator — concept and principle
This calculator finds the characteristic polynomial p(λ) = det(λI − A) of a square matrix, whose roots are the eigenvalues of A. It lists the coefficients, the sign-flipped form det(A − λI), the trace and the determinant. Use it as the first step in finding eigenvalues or to check a hand calculation.
How it is calculated
p(λ) = det(λI − A), a polynomial of degree n
det(A − λI) = (−1)ⁿ p(λ)
Coefficient of λⁿ⁻¹ = −trace(A); constant term = (−1)ⁿ det(A)
Faddeev–LeVerrier recurrence: M₁ = I, c_k = −trace(A M_k) ÷ k, M_(k+1) = A M_k + c_k I
- Whole-number matrices give whole-number coefficients, shown exactly.
The principle
λ is an eigenvalue of A when (A − λI)v = 0 has a non-zero solution v, which happens exactly when A − λI is singular, so its determinant is zero. Expanding that determinant gives a polynomial in λ. Its coefficients are built from sums of principal minors: the λⁿ⁻¹ term collects the diagonal (the trace) and the constant term is the determinant. The Faddeev–LeVerrier method finds all coefficients using only matrix products and traces, avoiding symbolic determinants.
Worked example
Default input: A = [2 0 0; 1 2 −1; 1 3 −2].
- Trace = 2 + 2 − 2 = 2, so the λ² coefficient is −2.
- Sum of the 2 × 2 principal minors = 4 + (−4) + (−1) = −1, the λ coefficient.
- det(A) = 2 × (2 × (−2) − (−1) × 3) = 2 × (−1) = −2, so the constant term is (−1)³ × (−2) = 2.
- p(λ) = λ³ − 2λ² − λ + 2, coefficients 1, −2, −1, 2, degree 3.
- det(A − λI) = −(λ³ − 2λ² − λ + 2).
How to read the result
Factor or solve p(λ) = 0 to get the eigenvalues. Here p(λ) = (λ − 2)(λ² − 1), so the eigenvalues are 2, 1 and −1. Their sum equals the trace (2) and their product equals the determinant (−2), a quick check on any answer.
Common mistakes
- Mixing det(λI − A) and det(A − λI) and getting the sign of every other coefficient wrong.
- Subtracting λ from every entry instead of only the diagonal.
- Arithmetic slips in 3 × 3 determinants; check with the trace and determinant.
- Expecting real roots; real matrices can have complex eigenvalues.
Frequently asked questions
What is the characteristic polynomial used for?
Its roots are the eigenvalues of the matrix.
What is the difference between det(λI − A) and det(A − λI)?
They differ by the factor (−1)ⁿ, so they have the same roots.
How can I check my answer?
The λⁿ⁻¹ coefficient should be −trace(A) and the constant term (−1)ⁿ det(A).
Sources: A. Davis, P. Zachlin et al., Coordinated Linear Algebra (University of Nebraska–Lincoln), §6.1 Eigenvalues and Eigenvectors