Characteristic Polynomial Calculator - det(xI - A)

Characteristic Polynomial Calculator

Type a matrix, read off det(xI − A), its eigenvalue roots, and a live Cayley–Hamilton check.

Matrix size

Matrix A (3×3)

Decimals and negatives are fine. Empty cells count as 0.

Convention

Variable

Characteristic polynomial — det(xI − A)

p(x) = x³ − 7x² + 15x − 9

The matrix xI − A

x − 2
-1
-0
-1
x − 2
-0
-0
-0
x − 3

x lands on the diagonal only. p(x) is this matrix’s determinant — but the coefficients on the right skip the symbolic expansion entirely.

Coefficients, read off the matrix

tr(A) = 2 + 2 + 3 = 7

M₁₁ = (2)(3) − (0)(0) = 6

M₂₂ = (2)(3) − (0)(0) = 6

M₃₃ = (2)(2) − (1)(1) = 3

ΣMᵢᵢ = 6 + 6 + 3 = 15

det(A) = 9

p(x) = x³ − tr(A)·x² + ΣMᵢᵢ·x − det(A)

Roots of p(x) = the eigenvalues of A

x = 3×2
x = 1

Sum of roots = 7 — matches tr(A) = 7

Product of roots = 9 — matches det(A) = 9

Cayley–Hamilton check: p(A) should be the zero matrix

p(A) = A³ − 7A² + 15A − 9I

0
0
0
0
0
0
0
0
0

Every matrix satisfies its own characteristic equation — substitute A for the variable (and multiply the constant by I) and everything cancels.

How to Use This Calculator

  1. Pick 2×2 or 3×3, then type your entries into the Matrix A grid — the polynomial updates as you type.
  2. Choose your textbook’s convention, det(xI − A) or det(A − xI), and switch the variable between x and λ to match your notes.
  3. Read the green result card for p(x), then check the “Coefficients, read off the matrix” panel to see the trace, principal minors, and determinant that built it.
  4. The blue panel lists the roots — the eigenvalues — with multiplicities, plus the trace and determinant cross-checks.
  5. Press “Load example” to cycle through a rotation matrix with complex roots, a triangular matrix, a singular one, and a nilpotent block with p(x) = x³.

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

Characteristic Polynomial Calculator: Three Numbers That Write det(xI − A)

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

📅 Published:
Characteristic polynomial calculator diagram of a 3x3 matrix becoming det(xI - A), a cubic curve crossing three eigenvalue roots

A characteristic polynomial calculator compresses an entire square matrix into one polynomial, det(xI − A), whose roots are the matrix’s eigenvalues. Here’s the part most students find out late: you almost never need to expand that determinant. For a 2×2 matrix the polynomial is always x² − tr(A)x + det(A) — two numbers you can read straight off the matrix — and the 3×3 case needs just one more ingredient.

The tool above accepts a 2×2 or 3×3 matrix and shows the whole chain: the symbolic matrix xI − A, the trace-and-minors recipe for each coefficient, the finished polynomial in your choice of convention and variable, the eigenvalue roots with multiplicities, and a live Cayley–Hamilton check that feeds A back into its own polynomial. Below, the same ideas by hand: the 2×2 and 3×3 shortcuts, the sign-convention split between textbooks, a table of polynomials you can write on sight, and what the roots and coefficients tell you before you solve anything.

Trace and Determinant Write the Whole 2×2 Polynomial

Take A = [[4, 2], [1, 3]]. The trace is the diagonal sum, 4 + 3 = 7. The determinant is 4·3 − 2·1 = 10. That’s everything:

p(x) = x² − tr(A)·x + det(A) = x² − 7x + 10 = (x − 2)(x − 5)

Why does this work? Expand the determinant honestly once: det(xI − A) = (x − 4)(x − 3) − (2)(1) = x² − 7x + 12 − 2 = x² − 7x + 10. The x-coefficient collects −4 and −3 — the negated diagonal, which is −tr(A) — and the constant term is what’s left when x = 0, which is det(−A) = det(A) for a 2×2. The formula isn’t a trick; it’s the expansion with the bookkeeping done once, forever.

The 3×3 Shortcut Every Characteristic Polynomial Calculator Uses

Expanding det(xI − A) symbolically for a 3×3 matrix means multiplying binomials inside six triple products — a swamp of sign errors. The coefficient route replaces all of it with three plain-number computations:

p(x) = x³ − tr(A)·x² + (M₁₁ + M₂₂ + M₃₃)·x − det(A)

Here M₁₁, M₂₂, M₃₃ are the principal minors: delete row 1 and column 1 (then 2, then 3) and take the 2×2 determinant of what remains. For A = [[2, 1, 0], [1, 2, 0], [0, 0, 3]]:

  • tr(A) = 2 + 2 + 3 = 7
  • M₁₁ = det[[2, 0], [0, 3]] = 6, M₂₂ = det[[2, 0], [0, 3]] = 6, M₃₃ = det[[2, 1], [1, 2]] = 3 → sum 15
  • det(A) = 3·(2·2 − 1·1) = 9

So p(x) = x³ − 7x² + 15x − 9, which factors as (x − 1)(x − 3)². Three small determinants of actual numbers, no symbolic algebra anywhere. Notice the sign rhythm too: the coefficients alternate −, +, − after the leading x³. That alternation is structural — the coefficient of xⁿ⁻ᵏ is (−1)ᵏ times the sum of the k×k principal minors — so a wrong sign pattern in your answer is an instant red flag.

det(xI − A) vs det(A − xI): Same Roots, Different Sign

Open two linear algebra books and you’ll likely meet two different definitions of the characteristic polynomial. They differ by exactly the factor (−1)ⁿ, so for even sizes they agree and for odd sizes every sign flips:

 det(xI − A)det(A − xI)
Leading coefficientalways +1 (monic)(−1)ⁿ
2×2 example abovex² − 7x + 10x² − 7x + 10 (identical)
3×3 example abovex³ − 7x² + 15x − 9−x³ + 7x² − 15x + 9
Roots (eigenvalues)1, 3, 31, 3, 3 (identical)
Typically used inabstract algebra texts; anywhere monic mattersintro courses — subtracting x down the diagonal feels natural

Neither is wrong, and eigenvalues can’t tell the difference — multiplying a polynomial by −1 moves no root. It only bites when an answer key expects one form and you hand in the other, which is why the calculator has a convention toggle instead of an opinion. If your homework says −λ³ + 7λ² − 15λ + 9 and the tool says λ³ − 7λ² + 15λ − 9, you’re both right.

Characteristic Polynomials You Can Read On Sight

Some matrix shapes give up their polynomial without any computation. Recognizing them saves real time on exams, because a triangular matrix hides its eigenvalues in plain view:

MatrixCharacteristic polynomialWhy
Triangular or diagonal, entries d₁ … dₙ on the diagonal(x − d₁)···(x − dₙ)xI − A stays triangular; its determinant is the diagonal product
Identity Iₙ(x − 1)ⁿdiagonal case with every dᵢ = 1
Zero matrix, or any nilpotent Jordan blockxⁿall eigenvalues are 0
2×2 rotation by angle θx² − 2cos(θ)·x + 1trace 2cos(θ), determinant 1; complex roots unless θ = 0 or π
Companion matrix of a monic polynomial qq(x) itselfbuilt so that its characteristic polynomial is q — every monic polynomial arises this way

The companion-matrix row answers a question worth pausing on: which polynomials can show up as characteristic polynomials? All of them (monic ones, anyway). The map from matrices to polynomials is onto — but it’s far from one-to-one. The 2×2 zero matrix and [[0, 1], [0, 0]] both have p(x) = x², yet one is as tame as matrices get and the other isn’t even diagonalizable. A characteristic polynomial pins down the eigenvalues, never the whole matrix.

From Roots to Eigenvalues — and Two Instant Checks

Setting p(x) = 0 gives the characteristic equation, and its solutions are precisely the eigenvalues of A. For x³ − 7x² + 15x − 9 = (x − 1)(x − 3)² the eigenvalues are 1 and 3, with 3 counted twice — its algebraic multiplicity is 2. Whether that repeated eigenvalue also carries two independent eigenvectors is a separate question, and it decides whether you can diagonalize the matrix.

Before solving anything, Vieta’s formulas hand you two free checks. The sum of all roots equals tr(A), and the product equals det(A). Our example: 1 + 3 + 3 = 7 = tr(A), and 1·3·3 = 9 = det(A). Both hold — and they’re sensitive enough that a single sign error in a coefficient almost always breaks one of them. This also explains a fact you may have met elsewhere: a matrix is singular exactly when 0 is an eigenvalue, because a zero root forces the product of roots, det(A), to be 0.

One more thing the polynomial quietly encodes: similarity. For any invertible P, det(xI − P⁻¹AP) = det(P⁻¹(xI − A)P) = det(xI − A), so similar matrices — same transformation, different basis — share one characteristic polynomial. That’s why trace and determinant survive every change of basis: they’re coefficients of an invariant.

Cayley–Hamilton: Feed the Matrix Its Own Polynomial

The Cayley–Hamilton theorem says every matrix satisfies its own characteristic equation: substitute A for x (and multiply the constant term by I) and the result is the zero matrix. With A = [[4, 2], [1, 3]] and p(x) = x² − 7x + 10:

A² = [[18, 14], [7, 11]]

A² − 7A + 10I = [[18 − 28 + 10, 14 − 14], [7 − 7, 11 − 21 + 10]] = [[0, 0], [0, 0]] ✓

This isn’t a party trick — it’s a workhorse. Rearranging A² − 7A + 10I = 0 gives A⁻¹ = (7I − A)/10, an inverse with no row reduction: [[0.3, −0.2], [−0.1, 0.4]], which you can verify multiplies back to I. It also tames high matrix powers: since A² = 7A − 10I, every higher power collapses to a combination of A and I. A³ = 7A² − 10A = 7(7A − 10I) − 10A = 39A − 70I — computed with two scalar multiplications instead of two matrix products. The calculator’s bottom panel runs exactly this substitution on your matrix and shows the zero matrix it lands on, entry by entry.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.