Characteristic Polynomial Calculator

Compute the characteristic polynomial \(p(\lambda)=\det(\lambda I - A)\) of an \(n \times n\) matrix. Enter your matrix and press Calculate.

Choose the matrix dimension. Most problems use 2×2 or 3×3.
Default is λ (lambda). You can use x, t, s, etc.
Enter numbers (integers or decimals). Leave blank = 0. Use negative values as needed.

Equation Preview

Your polynomial preview will render here…

Helping Notes

  • \(p_A(t)\) is monic: leading coefficient is 1.
  • \(c_{n-1} = -\mathrm{tr}(A)\); \(c_0 = (-1)^n \det(A)\) (use these to sanity-check).
  • For larger matrices or big entries, floating-point rounding can affect coefficients (Faddeev–LeVerrier is numerically sensitive).

Results

Expanded Polynomial
Coefficients (monic):
Trace & Determinant Checks

What is a Characteristic Polynomial Calculator?

A Characteristic Polynomial Calculator takes a square matrix \(A\in\mathbb{R}^{n\times n}\) (or \(\mathbb{C}^{n\times n}\)) and produces its characteristic polynomial \[ p_A(\lambda)=\det(\lambda I - A). \] The roots of \(p_A\) are the eigenvalues of \(A\), counted with algebraic multiplicity. The coefficients of \(p_A\) are invariant features of the matrix: up to sign, they are the elementary symmetric polynomials of the eigenvalues and can also be expressed through traces of powers of \(A\) or sums of principal minors. This calculator automates determinant expansion and efficient algorithms (e.g., Leverrier–Faddeev) to return exact polynomials for symbolic entries or precise numeric polynomials for floating-point input, alongside intermediate steps, checks, and compact summaries.

About the Characteristic Polynomial Calculator

For a \(2\times2\) matrix \(A=\begin{bmatrix}a&b\\c&d\end{bmatrix}\), \[ p_A(\lambda)=\lambda^2 - (\operatorname{tr}A)\,\lambda + \det A. \] For a \(3\times3\) matrix, with \(s_1=\operatorname{tr}A\), \(s_2=\tfrac12\big((\operatorname{tr}A)^2-\operatorname{tr}(A^2)\big)\), and \(s_3=\det A\), \[ p_A(\lambda)=\lambda^3 - s_1\lambda^2 + s_2\lambda - s_3. \] In general, the Leverrier–Faddeev recursion uses power sums \(t_k=\operatorname{tr}(A^k)\) to compute coefficients \(c_k\) in \[ p_A(\lambda)=\lambda^n + c_1\lambda^{n-1} + \cdots + c_n, \] via \[ c_k = -\frac{1}{k}\!\left(t_k+\sum_{i=1}^{k-1} c_i\, t_{k-i}\right),\qquad k=1,\dots,n. \] The calculator validates dimensions, supports exact arithmetic for rational/algebraic entries, and can verify Cayley–Hamilton by checking \(p_A(A)=0\).

How to Use this Characteristic Polynomial Calculator

  1. Enter your square matrix \(A\) (rows separated by semicolons or newlines; entries may be integers, fractions, or decimals).
  2. Choose the method: Determinant (definition), Leverrier–Faddeev (trace-based), or Minors (principal minors for low \(n\)).
  3. Compute to obtain \(p_A(\lambda)\), its factorization (when available), and the spectrum (eigenvalues) from the polynomial’s roots.
  4. (Optional) Show steps, including traces \(t_k\), intermediate coefficients \(c_k\), and determinant expansions.
  5. Export the polynomial and steps for reports, coursework, or further eigen-analysis.

Core Formulas (LaTeX)

Definition: \[ p_A(\lambda)=\det(\lambda I-A). \]

2×2 case: \[ p_A(\lambda)=\lambda^2-(\operatorname{tr}A)\lambda+\det A. \]

3×3 via traces: \[ p_A(\lambda)=\lambda^3 - (\operatorname{tr}A)\lambda^2 + \tfrac12\!\big((\operatorname{tr}A)^2-\operatorname{tr}(A^2)\big)\lambda - \det A. \]

Leverrier–Faddeev: \[ t_k=\operatorname{tr}(A^k),\qquad c_k=-\frac{1}{k}\!\left(t_k+\sum_{i=1}^{k-1}c_i\,t_{k-i}\right),\quad p_A(\lambda)=\lambda^n+\sum_{k=1}^{n} c_k \lambda^{n-k}. \]

Examples (Illustrative)

Example 1 — \(2\times2\) with repeated eigenvalue

\(A=\begin{bmatrix}2&1\\-1&4\end{bmatrix}\). \(\operatorname{tr}A=6\), \(\det A=9\). Thus \[ p_A(\lambda)=\lambda^2-6\lambda+9=(\lambda-3)^2. \]

Example 2 — Triangular \(3\times3\)

\(A=\begin{bmatrix}1&2&0\\0&3&0\\0&0&5\end{bmatrix}\). \(\operatorname{tr}A=9\); sum of order-2 principal minors \(=3+5+15=23\); \(\det A=15\). \[ p_A(\lambda)=(\lambda-1)(\lambda-3)(\lambda-5)=\lambda^3-9\lambda^2+23\lambda-15. \]

Example 3 — Leverrier–Faddeev (2×2)

\(A=\begin{bmatrix}0&1\\-2&-3\end{bmatrix}\). \(t_1=\operatorname{tr}A=-3\Rightarrow c_1= -t_1 = 3\). Compute \(A^2=\begin{bmatrix}-2&-3\\6&7\end{bmatrix}\), so \(t_2=5\). \[ c_2=-\frac{1}{2}(t_2+c_1 t_1)=-\frac{1}{2}(5+3\cdot(-3))=2. \] Hence \(p_A(\lambda)=\lambda^2+3\lambda+2=(\lambda+1)(\lambda+2).\)

FAQs

What does the characteristic polynomial represent?

It encodes a matrix’s eigenvalues; its roots (with multiplicities) are exactly the eigenvalues.

Can I compute the polynomial from traces only?

Yes—Leverrier–Faddeev uses \(t_k=\operatorname{tr}(A^k)\) to build coefficients recursively.

Why do coefficients involve trace and determinant?

They are elementary symmetric polynomials of eigenvalues; in low dimensions they reduce to trace and determinant combinations.

Does similarity change the characteristic polynomial?

No. Similar matrices share the same characteristic polynomial and eigenvalues.

How is this related to Cayley–Hamilton?

Every matrix satisfies its characteristic equation: \(p_A(A)=0\); the tool can verify this identity.

What if my matrix has symbolic entries?

The calculator can produce a symbolic polynomial; factorization depends on the algebraic complexity of entries.

More Math & Algebra Calculators