How to Find the Characteristic Polynomial of Any Matrix
Three questions students ask me every semester about this topic:
- 🤔 What exactly is the characteristic polynomial? It is the polynomial you get when you compute det(A − λI).
- 🤔 Why does it matter? Its roots are the eigenvalues — the numbers that unlock how a matrix transforms space.
- 🤔 How do you compute it without making sign errors? Follow a strict, step-by-step determinant expansion — and let the calculator below check your work.
The characteristic polynomial of a square matrix A is p(λ) = det(A − λI). You subtract λ from every diagonal entry, then expand the determinant. The resulting polynomial’s roots are the eigenvalues of A — the scalars that satisfy Av = λv for some non-zero vector v.
⚡ In Short
- 📌 Characteristic polynomial = det(A − λI), always monic of degree n.
- 📌 Roots of p(λ) = 0 are the eigenvalues of A.
- 📌 2×2 shortcut: p(λ) = λ² − (trace)λ + (det A).
- 📌 3×3 requires cofactor expansion — three 2×2 sub-determinants.
- 📌 Cayley–Hamilton: every matrix satisfies its own characteristic equation.
- 📌 Use the calculator below to verify your hand-computed polynomial instantly.
🧮 Interactive Characteristic Polynomial Calculator
Characteristic Polynomial Calculator
Compute det(A − λI) and eigenvalues instantly
Enter matrix entries (row by row):
📐 Step-by-Step Solution
How to Use This Calculator
- Choose matrix size — click 2×2 or 3×3.
- Enter each entry in the labeled grid. Integers and decimals both work.
- Click Calculate (or press Enter in any field). The calculator computes det(A − λI) and solves for eigenvalues.
- Read the step-by-step solution to see exactly how each number was derived.
- Click Reset to clear all fields and start fresh.
What Is the Characteristic Polynomial?
The characteristic polynomial of a square matrix A is the polynomial p(λ) = det(A − λI), where λ is an indeterminate scalar and I is the identity matrix of the same size. It encodes the eigenvalue structure of A completely.
In my experience teaching linear algebra, students often confuse the characteristic polynomial with the minimal polynomial. They share the same roots, but the minimal polynomial is the smallest-degree monic polynomial that sends A to the zero matrix — it may have lower degree when eigenvalues repeat.
The characteristic polynomial is central to spectral theory, stability analysis, and quantum mechanics. Every eigenvalue problem starts here.
The Formula Explained + Variables Table
The formula is p(λ) = det(A − λI). You subtract λ from each diagonal entry of A, leaving all off-diagonal entries unchanged, then compute the determinant of the resulting matrix.
For a 2×2 matrix A = | a b |
| c d |
A − λI = | a−λ b |
| c d−λ |
det(A − λI) = (a−λ)(d−λ) − bc
= λ² − (a+d)λ + (ad−bc)
= λ² − tr(A)·λ + det(A)
─────────────────────────────────────
For a 3×3 matrix:
p(λ) = −λ³ + tr(A)λ² − (sum of 2×2 principal minors)λ + det(A)
Monic form: λ³ − tr(A)λ² + (sum of minors)λ − det(A)
| Symbol | Meaning | Notes |
|---|---|---|
| A | Square matrix (n×n) | Real or complex entries |
| λ (lambda) | Scalar variable (eigenvalue parameter) | Indeterminate in the polynomial |
| I | Identity matrix (n×n) | 1s on diagonal, 0s elsewhere |
| det(·) | Determinant | Scalar-valued function of a matrix |
| tr(A) | Trace of A | Sum of diagonal entries |
| p(λ) | Characteristic polynomial | Monic, degree n |
Fully Worked Examples
Example 1 — 2×2 Matrix
Find the characteristic polynomial and eigenvalues of A = [[3, 1], [2, 4]].
- Form A − λI: [[3−λ, 1], [2, 4−λ]].
- Compute det: (3−λ)(4−λ) − (1)(2) = 12 − 7λ + λ² − 2 = λ² − 7λ + 10.
- Characteristic polynomial: p(λ) = λ² − 7λ + 10.
- Solve: λ² − 7λ + 10 = 0 → (λ−5)(λ−2) = 0 → λ₁ = 5, λ₂ = 2.
- Check: tr(A) = 3 + 4 = 7 = 5 + 2 ✓; det(A) = 12 − 2 = 10 = 5 × 2 ✓.
I always tell my students to verify eigenvalues by checking that their sum equals the trace and their product equals the determinant. This two-second check catches 90% of sign errors before they cause problems downstream.
Example 2 — 3×3 Matrix
Find the characteristic polynomial of B = [[2, 0, 1], [0, 3, 0], [1, 0, 2]].
- tr(B) = 2 + 3 + 2 = 7.
- Principal 2×2 minors: M₁₂ = 2·3 − 0·0 = 6; M₁₃ = 2·2 − 1·1 = 3; M₂₃ = 3·2 − 0·0 = 6; sum = 15.
- det(B) = 2(3·2 − 0·0) − 0 + 1(0·0 − 3·1) = 12 − 3 = 9.
- Characteristic polynomial: p(λ) = λ³ − 7λ² + 15λ − 9.
- Factor: try λ = 1 → 1 − 7 + 15 − 9 = 0 ✓. Factor out (λ−1): p(λ) = (λ−1)(λ² − 6λ + 9) = (λ−1)(λ−3)².
- Eigenvalues: λ₁ = 1, λ₂ = λ₃ = 3 (3 is a repeated eigenvalue).
2×2 vs. 3×3: Side-by-Side Comparison
| Feature | 2×2 Matrix | 3×3 Matrix |
|---|---|---|
| Polynomial degree | 2 (quadratic) | 3 (cubic) |
| Number of eigenvalues | 2 (with multiplicity) | 3 (with multiplicity) |
| Formula shortcut | λ² − tr·λ + det | λ³ − tr·λ² + (sum minors)·λ − det |
| Solving method | Quadratic formula | Rational root test + factoring, or Cardano |
| Can have complex roots? | Yes, if disc < 0 | Yes, always in conjugate pairs |
| Trace = sum of eigenvalues? | Yes | Yes |
| Det = product of eigenvalues? | Yes | Yes |
Common Mistakes — Wrong vs. Right
✅ Right: Only subtract λ from a₁₁, a₂₂, a₃₃. Off-diagonal entries stay unchanged.
✅ Right: det(λI − A) = (−1)ⁿ · det(A − λI). Both have the same roots, but the sign of the leading coefficient differs for odd n. Most textbooks use det(A − λI) for the monic form.
✅ Right: Always verify: eigenvalue sum = trace, eigenvalue product = determinant. This catches arithmetic errors in under 5 seconds.
In my experience grading linear algebra exams, the single most common error is a sign flip when expanding the 3×3 determinant — students forget the alternating + − + pattern on the cofactor expansion. Writing the cofactor signs explicitly before expanding saves more points than any other single habit.
❗ Commonly Misunderstood
Most guides treat the characteristic polynomial purely as a computation tool — expand the determinant, get the roots, done. What they rarely mention is that the coefficients themselves carry geometric meaning. For an n×n matrix, the coefficient of λⁿ⁻¹ is always −tr(A) (the sum of eigenvalues), the constant term is always (−1)ⁿ det(A) (the product of eigenvalues), and every intermediate coefficient is a signed sum of k×k principal minors. This means you can read off partial eigenvalue information — like whether the product of eigenvalues is positive or negative — directly from the matrix entries, without solving the polynomial at all. That shortcut is genuinely useful in stability analysis, where you only need to know whether all eigenvalues have negative real parts, not their exact values.
Real-World Applications
Eigenvalues — the roots of the characteristic polynomial — appear across science and engineering. Here are four concrete uses:
- 🏗️ Structural engineering: Natural vibration frequencies of a bridge or building are eigenvalues of the stiffness matrix. Engineers compute them to avoid resonance.
- 📊 Data science (PCA): Principal Component Analysis finds the eigenvalues of a covariance matrix. The largest eigenvalue points in the direction of maximum variance.
- 🔬 Quantum mechanics: Observable quantities (energy levels, spin) are eigenvalues of Hermitian operators. The eigenvalue equation Av = λv is the foundation of quantum theory.
- 🌐 Google PageRank: The ranking vector is the dominant eigenvector of the web’s link matrix — found by iterating toward the largest eigenvalue.
Practice Problems — Reveal the Solution
Problem 1: Find p(λ) for A = [[5, 2], [1, 4]]
Step 1: tr(A) = 5 + 4 = 9. det(A) = 20 − 2 = 18.
Step 2: p(λ) = λ² − 9λ + 18.
Step 3: Solve: (λ−6)(λ−3) = 0 → λ₁ = 6, λ₂ = 3.
Check: 6 + 3 = 9 = tr ✓; 6 × 3 = 18 = det ✓.
Problem 2: Find p(λ) for B = [[0, −1], [1, 0]] (rotation matrix)
Step 1: tr(B) = 0. det(B) = 0·0 − (−1)(1) = 1.
Step 2: p(λ) = λ² − 0·λ + 1 = λ² + 1.
Step 3: Solve: λ² = −1 → λ = ±i (pure imaginary — this matrix rotates by 90°, so no real eigenvalues).
Problem 3: Find p(λ) for C = [[1, 0, 0], [0, 2, 0], [0, 0, 3]] (diagonal matrix)
Step 1: C − λI is diagonal: [[1−λ, 0, 0], [0, 2−λ, 0], [0, 0, 3−λ]].
Step 2: det = (1−λ)(2−λ)(3−λ).
Step 3: Expand: p(λ) = λ³ − 6λ² + 11λ − 6.
Eigenvalues: λ = 1, 2, 3 — the diagonal entries, as expected for any diagonal matrix.
Frequently Asked Questions
What is the characteristic polynomial of a matrix?
How do you find the characteristic polynomial of a 2×2 matrix?
What are eigenvalues and how do they relate to the characteristic polynomial?
Can a matrix have complex eigenvalues?
Is the characteristic polynomial the same as the minimal polynomial?
What does the Cayley–Hamilton theorem say?
What is the trace-determinant shortcut for 2×2 eigenvalues?
How many eigenvalues does an n×n matrix have?
Sources & References
- Wikipedia — Characteristic Polynomial — comprehensive definition, properties, and proofs.
- Wikipedia — Eigenvalues and Eigenvectors — applications across physics, data science, and engineering.
- Khan Academy — Introduction to Eigenvalues and Eigenvectors — accessible video walkthrough of the core concepts.
✍ Editorial note: This article was written and fact-checked by Dr. Irfan Mansuri. All formulas, examples, and calculator outputs were verified by hand. No statistics or studies were fabricated. Last reviewed November 2026.

