Characteristic Polynomial Calculator: Steps & Formula
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator finds the characteristic polynomial of a square matrix, which is the polynomial whose roots are the eigenvalues. You enter the matrix size and its entries, and it returns the polynomial coefficients (or the polynomial in expanded form) plus the eigenvalues. The calculation uses the standard determinant formula det(A − λI) = 0, with the result given in descending powers of λ.
Formula
For an n×n matrix A, the characteristic polynomial is defined as:
p(λ) = det(A − λI)
where λ is a scalar variable (the eigenvalue), I is the n×n identity matrix, and det() is the determinant. Expanding this determinant gives a polynomial of degree n:
p(λ) = λn + cn−1λn−1 + … + c1λ + c0
For a 2×2 matrix [[a, b], [c, d]], the formula simplifies to:
p(λ) = λ2 − (a + d)λ + (ad − bc)
Here, (a + d) is the trace (sum of diagonal entries) and (ad − bc) is the determinant. For larger matrices, the coefficients are more complex, but the principle is the same: compute det(A − λI) and expand.
Worked Example
Using the default 2×2 matrix [[2, 1], [1, 2]]:
- Write A − λI: [[2−λ, 1], [1, 2−λ]]
- Compute the determinant: (2−λ)(2−λ) − (1)(1) = (2−λ)2 − 1
- Expand: (4 − 4λ + λ2) − 1 = λ2 − 4λ + 3
- So the characteristic polynomial is λ2 − 4λ + 3.
The eigenvalues are the roots of this polynomial: λ = 1 and λ = 3. The calculator’s formula gives the same: ((2+2) ± sqrt((4)2 − 4*3))/2 = (4 ± sqrt(4))/2 = 3 and 1.
Why the Characteristic Polynomial Matters
Eigenvalues appear in almost every applied math field. They tell you how a system behaves under repeated transformations: whether a matrix stretches, shrinks, or rotates vectors. In physics, they give natural frequencies; in engineering, they determine stability of control systems; in data science, they underlie principal component analysis. The characteristic polynomial is the bridge between the matrix and its eigenvalues—once you have it, you can find the eigenvalues by solving p(λ) = 0.
For a 2×2 matrix, the polynomial directly shows the trace and determinant, which are invariant under basis changes. For larger matrices, the coefficients are combinations of principal minors, and the constant term equals (−1)n times the determinant.
How to Use the Calculator
- Select the matrix size (2, 3, or 4). The calculator currently supports 2×2; for larger sizes, use a more general tool.
- Enter each matrix entry. For a 2×2, the entries are a, b, c, d (row by row).
- Read the characteristic polynomial in the first output. The calculator also gives the two eigenvalues (which may be complex if the discriminant is negative).
- If you need the polynomial for a 3×3 or larger matrix, use a computer algebra system or a dedicated linear algebra calculator.
Common Mistakes and Pitfalls
- Sign errors: The formula uses det(A − λI), not det(λI − A). Both give the same roots, but the leading coefficient differs by a sign if n is odd.
- Forgetting the identity matrix: A − λI means subtract λ from the diagonal entries only, not from every entry.
- Misordering coefficients: The polynomial is usually written with the highest power first. Some textbooks write it in ascending order.
- Rounding too early: When computing eigenvalues from the polynomial, keep full precision until the final step.
Limitations and When to Use Another Method
For 2×2 matrices, the formula is simple and fast. For 3×3, the characteristic polynomial is cubic; you can compute it by hand using the rule of Sarrus or cofactor expansion, but it quickly becomes tedious. For 4×4 and larger, the polynomial degree is high and the coefficients can be numerically unstable. In practice, numerical algorithms (like the QR algorithm) compute eigenvalues directly without ever forming the characteristic polynomial. This calculator is best for small matrices, educational purposes, or quick checks.
Also note: the characteristic polynomial is monic (leading coefficient 1). If you see a polynomial with a different leading coefficient, it may be the characteristic polynomial multiplied by a constant, which still has the same roots.
Frequently Asked Questions
What is the characteristic polynomial used for?
It’s used to find eigenvalues, which are central to solving systems of differential equations, analyzing stability, diagonalizing matrices, and many other applications. The polynomial itself also encodes invariants like trace and determinant.
How do I find the characteristic polynomial of a 3×3 matrix?
Compute det(A − λI) using cofactor expansion or the rule of Sarrus. For a 3×3 matrix, you’ll get a cubic polynomial. The process is mechanical but lengthy; a calculator or software is recommended.
What if the eigenvalues are complex?
That’s fine. The characteristic polynomial can have complex roots even if the matrix has real entries. For example, a rotation matrix has eigenvalues i and −i. The calculator will show them as complex numbers if you use a tool that supports them.
Why is the polynomial always monic?
The leading coefficient comes from the product of the diagonal terms (a11−λ)(a22−λ)…, which always gives (−1)nλn. Since we use det(A − λI), the leading coefficient is 1. If you use det(λI − A), it becomes (−1)n.
Can I use this for non-square matrices?
No. The characteristic polynomial is only defined for square matrices. Non-square matrices have singular values, but not eigenvalues in the same sense.
Does the calculator work for symbolic entries?
No, it only accepts numbers. For symbolic matrices (with variables), use a computer algebra system like SymPy or Mathematica.
Related
Formula used
in n | Matrix size | - | 2 | 2 in a | a11 | - | 2 | - in b | a12 | - | 1 | - in c | a21 | - | 1 | - in d | a22 | - | 2 | - out poly | Characteristic polynomial | - | λ^2 - (a + d)λ + (a*d - b*c) | 0 out ev1 | Eigenvalue 1 | - | ((a + d) + sqrt((a + d)^2 - 4*(a*d - b*c))) / 2 | 4 out ev2 | Eigenvalue 2 | - | ((a + d) - sqrt((a + d)^2 - 4*(a*d - b*c))) / 2 | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.