Characteristic Polynomial Calculator
Calculate the characteristic polynomial p(λ) = det(λI − A), eigenvalues, matrix trace, determinant, and step-by-step Faddeev-LeVerrier iterations with exact rational arithmetic.
4, -1.5, or 3/2): = (λ − 3)²(λ − 5)
11
Negative of λⁿ⁻¹ coefficient
45
Constant term = (−1)ⁿ c_n
λ = 3, 5
Roots where p(λ) = 0
Faddeev-LeVerrier Algorithm Derivation Steps
O(n⁴) Exact Trace RecurrenceCharacteristic Polynomial: det(λI − A)
The characteristic polynomial of an n × n square matrix A is the unique polynomial p(λ) = det(λI − A) whose roots are the eigenvalues of A. Its degree matches the matrix dimension n, the coefficient of λⁿ⁻¹ is always the negative trace −tr(A), and the constant term equals (−1)ⁿ det(A).
What Is the Characteristic Polynomial?
In linear algebra, the characteristic polynomial is the central bridge connecting matrix transformations with algebraic polynomials. If A is an n × n square matrix, an eigenvalue λ and its associated nonzero eigenvector v satisfy:
For a nonzero eigenvector v to exist, the matrix (λ I − A) must be singular (non-invertible), which requires its determinant to equal zero:
pA(λ) = det(λ I − A) = 0
"The Characteristic Equation of Matrix A"
Expanding this determinant yields an n-th degree polynomial in the variable λ. The roots of this polynomial are precisely the eigenvalues of A.
Formulas for 2×2 and 3×3 Matrices
For small matrices, calculating determinants symbolically via cofactor expansion yields elegant, memorable formulas based directly on matrix invariants:
Where tr(A) = a₁₁ + a₂₂ is the trace (sum of the main diagonal entries) and det(A) = a₁₁a₂₂ − a₁₂a₂₁ is the determinant.
Where M is the sum of the three principal 2×2 minors: M = M₁₁ + M₂₂ + M₃₃ = tr(adj(A)).
Step-by-Step Worked Examples
Let A = [[3, 1], [0, 2]].
1. Compute Trace: tr(A) = 3 + 2 = 5.
2. Compute Determinant: det(A) = (3)(2) − (1)(0) = 6.
3. Apply formula: p(λ) = λ² − 5λ + 6.
4. Factoring: (λ − 3)(λ − 2) = 0 ⇒ λ₁ = 3, λ₂ = 2.
Let A = [[0, −1], [1, 0]] (Standard 90° rotation matrix).
1. Trace: tr(A) = 0 + 0 = 0.
2. Determinant: det(A) = (0)(0) − (−1)(1) = 1.
3. Polynomial: p(λ) = λ² − (0)λ + 1 = λ² + 1.
4. Eigenvalues: λ² = −1 ⇒ λ = ±i (Pure imaginary eigenvalues indicate pure spatial rotation).
If a matrix is upper triangular, lower triangular, or diagonal, its determinant is simply the product of its diagonal entries. Therefore:
det(λI − A) = (λ − a₁₁)(λ − a₂₂) ... (λ − aₙₙ).
The eigenvalues of any triangular matrix are simply the numbers on its main diagonal!
The Cayley-Hamilton Theorem & Matrix Inverses
One of the crown jewels of linear algebra is the Cayley-Hamilton Theorem, proved by Arthur Cayley in 1858:
pA(A) = 0
"Every square matrix satisfies its own characteristic polynomial."
For instance, if a 2×2 matrix has characteristic polynomial p(λ) = λ² − 4λ + 3, then:
A² − 4A + 3I = 0
3I = 4A − A² ⇒ A−¹ = (4I − A) / 3
This reveals that the inverse matrix A⁻¹ can always be computed as a simple linear combination of powers of A (up to Aⁿ⁻¹), without solving large Gaussian linear systems!
The Faddeev-LeVerrier Algorithm
Symbolically expanding the determinant of an n × n matrix requires computing n! permutations, which becomes computationally impossible for large matrices (for n = 10, 10! = 3,628,800 terms).
The Faddeev-LeVerrier algorithm solves this problem by using recurrence relations involving matrix multiplication and trace:
Initialize: M₀ = 0, c₀ = 1
For k = 1, 2, ..., n:
Mk = A · Mk−1 + ck−1 I
ck = −(1/k) tr(A · Mk)
This algorithm computes all polynomial coefficients in O(n⁴) arithmetic operations, while simultaneously yielding the matrix inverse:
A⁻¹ = −(1 / cₙ) Mₙ (when cₙ ≠ 0).
Matrix Invariants Encoded in Coefficients
The coefficients of the characteristic polynomial are geometric and algebraic invariants of the underlying linear transformation:
| Polynomial Term | Coefficient Meaning | Geometric Property |
|---|---|---|
| λⁿ | +1 | Monic normal form |
| λⁿ⁻¹ | −tr(A) | Negative sum of all eigenvalues ∑ λᵢ |
| Constant (cₙ) | (−1)ⁿ det(A) | Product of all eigenvalues ∏ λᵢ |
Similarity Invariance: If matrix B is similar to A (B = P⁻¹ A P for some invertible matrix P), then A and B have identical characteristic polynomials, identical eigenvalues, identical trace, and identical determinant.
Common Calculation Mistakes & Sign Errors
1. The Alternating Sign Error in 2×2 Polynomials
Students often accidentally write λ² + tr(A)λ + det(A) instead of λ² − tr(A)λ + det(A). The trace term MUST have a negative sign in the monic polynomial!
2. Subtracting in the Wrong Direction
Remember that in λI − A, the diagonal elements are (λ − aᵢᵢ), while the off-diagonal elements are negated (−aᵢⱼ). Forgetting to negate off-diagonal terms changes the determinant completely.
3. Attempting to Compute for Non-Square Matrices
The characteristic polynomial is strictly defined only for square n × n matrices. Rectangular matrices (e.g. 2×3) do not have determinants or eigenvalues (their spectral behavior is analyzed via Singular Value Decomposition, SVD).
Applications in Physics, Vibration & Data Science
In civil engineering, the roots of the stiffness-mass characteristic polynomial det(K − ω²M) = 0 yield the natural resonant frequencies (ω) of bridges and skyscrapers.
In quantum mechanics, the roots of the Hamiltonian matrix's characteristic polynomial det(H − E I) = 0 represent the allowed quantized energy levels (E) of an atom.
In machine learning and statistics, the characteristic polynomial of a covariance matrix isolates the directions of maximum variance in high-dimensional datasets.
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.