Algebra • Linear Algebra & Matrix Analysis

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.

|
Last Updated: September 2026
|
Linear Algebra & Spectral Theory Verified
Matrix Size (n × n):
3 × 3
Enter real or fractional coefficients for Matrix A (e.g. 4, -1.5, or 3/2):
A =
Characteristic Polynomial Expression
p(λ) = λ³ − 11λ² + 39λ − 45

= (λ − 3)²(λ − 5)

Trace tr(A)

11

Negative of λⁿ⁻¹ coefficient

Determinant det(A)

45

Constant term = (−1)ⁿ c_n

Real Eigenvalues

λ = 3, 5

Roots where p(λ) = 0

Faddeev-LeVerrier Algorithm Derivation Steps

O(n⁴) Exact Trace Recurrence
Direct Answer & Overview
Verified Educational Guide

Characteristic 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).

Primary Mathematical Formula Fundamental Spectral Invariant of Square Matrices
Standard Equation
ƒ(x)
Q.E.D.
pA(λ)=det⁡(λIn−A)=λn−tr(A)λn−1+⋯+(−1)ndet⁡(A)p_A(\lambda) = \det(\lambda I_n - A) = \lambda^n - \text{tr}(A)\lambda^{n-1} + \dots + (-1)^n \det(A)
By the Cayley-Hamilton Theorem, every square matrix satisfies its own characteristic equation: p_A(A) = 0.
Exact Formula
Input Parameters
Required
1
Square Matrix (A): Any real or rational n × n square matrix
2
Identity Matrix (I): Corresponding n × n identity matrix with 1s on diagonal
3
Eigenvalue Parameter (λ): The scalar algebraic indeterminate
Expected Outputs
Calculated
Polynomial p(λ): Monic or determinantal characteristic polynomial expression
Trace tr(A): Sum of main diagonal entries (a₁₁ + a₂₂ + ... + aₙₙ)
Determinant det(A): Total geometric volume scaling factor
Eigenvalues (λ_i): Exact or numerical roots where p(λ) = 0
Worked Numerical Example
Instant Verification
Find the characteristic polynomial of A = [[2, 1], [1, 2]].
→ det(λI - A) = det([[λ - 2, -1], [-1, λ - 2]]) = (λ - 2)² - (-1)(-1) = λ² - 4λ + 4 - 1 = λ² - 4λ + 3. Factoring gives (λ - 3)(λ - 1).
p(λ) = λ² − 4λ + 3; Roots: λ₁ = 3, λ₂ = 1

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:

A v = λ v  ⇔  (λ I − A) v = 0

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:

The 2×2 Master Formula
p(λ) = λ² − tr(A)λ + det(A)

Where tr(A) = a₁₁ + a₂₂ is the trace (sum of the main diagonal entries) and det(A) = a₁₁a₂₂ − a₁₂a₂₁ is the determinant.

The 3×3 Master Formula
p(λ) = λ³ − tr(A)λ² + Mλ − det(A)

Where M is the sum of the three principal 2×2 minors: M = M₁₁ + M₂₂ + M₃₃ = tr(adj(A)).

Step-by-Step Worked Examples

Example 1: 2×2 Symmetric Matrix p(λ) = λ² − 5λ + 6

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.

Example 2: 2×2 Anti-Symmetric (Complex Roots) p(λ) = λ² + 1

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).

Example 3: Triangular Matrix Shortcut p(λ) = (λ − 4)(λ − 7)(λ + 2)

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

Structural Resonance

In civil engineering, the roots of the stiffness-mass characteristic polynomial det(K − ω²M) = 0 yield the natural resonant frequencies (ω) of bridges and skyscrapers.

Quantum Energy Levels

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.

Principal Component Analysis

In machine learning and statistics, the characteristic polynomial of a covariance matrix isolates the directions of maximum variance in high-dimensional datasets.

Fact-Checked & Verified • Computational Accuracy Standards
Updated September 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is the characteristic polynomial of a matrix?
The characteristic polynomial of an n × n square matrix A is the polynomial p(λ) = det(λI − A) (or det(A − λI)). The roots of this polynomial are the exact eigenvalues of the matrix, which govern its algebraic scaling, invariant subspaces, and diagonalizability.
What is the difference between det(λI − A) and det(A − λI)?
Both definitions produce the exact same eigenvalues (roots). The monic convention p(λ) = det(λI − A) always has a leading coefficient of +1 (λⁿ + ...), while det(A − λI) includes an alternating sign factor of (-1)ⁿ. In modern linear algebra, the monic form det(λI − A) is the standard.
How do you find the characteristic polynomial of a 2×2 matrix?
For any 2×2 matrix A = [[a, b], [c, d]], the characteristic polynomial is given directly by p(λ) = λ² − tr(A)λ + det(A), where tr(A) = a + d (the trace) and det(A) = ad − bc (the determinant).
What does the Cayley-Hamilton Theorem state?
The Cayley-Hamilton Theorem states that every square matrix satisfies its own characteristic polynomial: p(A) = 0 (the zero matrix). This provides a straightforward way to compute matrix inverses (A⁻¹) and high matrix powers (Aᵏ) without repeated matrix multiplication.
What is the Faddeev-LeVerrier algorithm?
The Faddeev-LeVerrier algorithm is an efficient, determinant-free numerical method for finding all coefficients of a characteristic polynomial simultaneously using matrix multiplications and trace operations in O(n⁴) steps, while also providing the adjugate matrix.
Can a characteristic polynomial have complex roots?
Yes. Even if a matrix contains only real numbers (e.g., a 90-degree rotation matrix [[0, -1], [1, 0]]), its characteristic polynomial can have complex conjugate roots (such as λ = ±i). These complex eigenvalues represent rotation without pure scaling in the real plane.