Skip to main content

Characteristic Polynomial Calculator

Compute p(λ) = det(A − λI) for any 2×2 or 3×3 matrix — the polynomial in λ, its coefficients, trace, determinant, and eigenvalues (the roots of the characteristic equation), with step-by-step working.

For a 2×2 matrix: p(λ) = λ² − tr(A)·λ + det(A). For 3×3: p(λ) = −λ³ + tr(A)·λ² − s₂·λ + det(A), where s₂ is the sum of the three principal 2×2 minors. Quadratic roots are exact; cubic roots use Cardano's formula.

Compute

Worked examples

Example 1 — 2×2 with two distinct real eigenvalues

A = [[4, 2], [1, 3]]

Trace: tr(A) = 4 + 3 = 7. Determinant: det(A) = 4·3 − 2·1 = 12 − 2 = 10.

p(λ) = λ² − tr(A)·λ + det(A) = λ² − 7λ + 10

Solve λ² − 7λ + 10 = 0. Discriminant D = 49 − 40 = 9, so λ = (7 ± 3)/2.

Eigenvalues: λ₁ = 2, λ₂ = 5  ·  check: p(2) = 4 − 14 + 10 = 0 ✓, p(5) = 25 − 35 + 10 = 0 ✓

Example 2 — 2×2 rotation (complex eigenvalues)

A = [[0, −1], [1, 0]]

Trace: tr(A) = 0 + 0 = 0. Determinant: det(A) = 0·0 − (−1)·1 = 1.

p(λ) = λ² − 0·λ + 1 = λ² + 1
Eigenvalues: λ₁ = −i, λ₂ = i  ·  check: p(i) = −1 + 1 = 0 ✓

A real matrix can have nonreal eigenvalues — here a 90° rotation has no real eigenvector.

Example 3 — 3×3 upper triangular

A = [[2, 1, 0], [0, 3, 1], [0, 0, 4]]

Trace: tr(A) = 2 + 3 + 4 = 9. Principal 2×2 minors: M₁ = 3·4 − 1·0 = 12, M₂ = 2·4 − 0·0 = 8, M₃ = 2·3 − 1·0 = 6, so s₂ = 12 + 8 + 6 = 26. Determinant (triangular): det(A) = 2·3·4 = 24.

p(λ) = −λ³ + 9λ² − 26λ + 24
Eigenvalues: λ₁ = 2, λ₂ = 3, λ₃ = 4 (triangular matrix: eigenvalues sit on the diagonal)

Check: p(2) = −8 + 36 − 52 + 24 = 0 ✓, p(3) = −27 + 81 − 78 + 24 = 0 ✓, p(4) = −64 + 144 − 104 + 24 = 0 ✓.

Example 4 — 3×3 singular matrix (zero eigenvalue)

A = [[1, 2, 3], [0, 4, 5], [0, 0, 0]]

Trace: tr(A) = 1 + 4 + 0 = 5. Principal 2×2 minors: M₁ = 4·0 − 5·0 = 0, M₂ = 1·0 − 3·0 = 0, M₃ = 1·4 − 2·0 = 4, so s₂ = 4. Determinant: det(A) = 0 (zero row).

p(λ) = −λ³ + 5λ² − 4λ = −λ(λ − 1)(λ − 4)
Eigenvalues: λ₁ = 0, λ₂ = 1, λ₃ = 4

The zero constant term (det(A) = 0) forces λ = 0 to be an eigenvalue — the matrix is singular. Check: p(1) = −1 + 5 − 4 = 0 ✓, p(4) = −64 + 80 − 16 = 0 ✓.

Frequently asked questions

What is the characteristic polynomial of a matrix?

The characteristic polynomial of a square matrix A is p(λ) = det(A − λI), where λ is a scalar variable and I is the identity matrix of the same size. It is a polynomial of degree n for an n×n matrix, and its coefficients are built from the trace, determinant, and principal minors of A.

What is the characteristic polynomial of a 2×2 matrix?

For A = [[a, b], [c, d]], it is p(λ) = λ² − tr(A)·λ + det(A), where tr(A) = a + d and det(A) = ad − bc. Example: A = [[4, 2], [1, 3]] has tr(A) = 7 and det(A) = 10, so p(λ) = λ² − 7λ + 10 = (λ − 2)(λ − 5).

What is the characteristic polynomial of a 3×3 matrix?

p(λ) = −λ³ + tr(A)·λ² − s₂·λ + det(A), where s₂ is the sum of the three principal 2×2 minors of A. Example: the upper-triangular matrix [[2, 1, 0], [0, 3, 1], [0, 0, 4]] has tr(A) = 9, s₂ = 12 + 8 + 6 = 26 and det(A) = 24, so p(λ) = −λ³ + 9λ² − 26λ + 24.

How do eigenvalues relate to the characteristic polynomial?

The eigenvalues of A are exactly the roots of its characteristic polynomial: the values λ with p(λ) = 0, equivalently det(A − λI) = 0. Example: the rotation matrix [[0, −1], [1, 0]] has p(λ) = λ² + 1, whose roots are λ = i and λ = −i — so a real matrix can have nonreal eigenvalues.

What does it mean if the constant term of the characteristic polynomial is zero?

The constant term of p(λ) = det(A − λI) equals det(A). If it is zero, then p(0) = 0, so λ = 0 is an eigenvalue and A is singular (not invertible). Example: [[1, 2, 3], [0, 4, 5], [0, 0, 0]] gives p(λ) = −λ³ + 5λ² − 4λ = −λ(λ − 1)(λ − 4), with eigenvalues 0, 1, 4.

Why does the calculator sometimes show repeated or complex eigenvalues?

A repeated root means an eigenvalue with algebraic multiplicity greater than 1. For example, [[2, 1, 0], [1, 2, 0], [0, 0, 3]] has p(λ) = −λ³ + 7λ² − 15λ + 9 = −(λ − 1)(λ − 3)², so the eigenvalues are 1, 3, 3. Nonreal eigenvalues of a real matrix always come in conjugate pairs, and every cubic characteristic polynomial has at least one real root.

Is the characteristic polynomial the same as the minimal polynomial?

No. The characteristic polynomial always has degree n, while the minimal polynomial is the lowest-degree monic polynomial that annihilates A; it divides the characteristic polynomial. Example: the 2×2 identity matrix has characteristic polynomial (λ − 1)² but minimal polynomial (λ − 1).

Does multiplying the polynomial by −1 change the eigenvalues?

No. This calculator writes p(λ) = det(A − λI), whose leading coefficient is (−1)ⁿ, while many textbooks use det(λI − A) = (−1)ⁿ·p(λ). The two forms differ only by an overall sign, so they have exactly the same roots and the same eigenvalues. For 2×2 matrices both conventions coincide because (−1)² = 1.

Free tool by NRTechStudio