Characteristic Polynomial Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Definition and Intuition

For a square matrix A, the characteristic polynomial is a single polynomial that captures key information about how the matrix acts on vectors. It is defined as the determinant of A minus a scalar multiple of the identity matrix:

p(λ) = det(A − λI), where λ (lambda) is a scalar variable and I is the identity matrix of the same size as A.

Conceptually, this polynomial measures when the matrix A − λI becomes singular (non-invertible). Values of λ that make the determinant zero are the eigenvalues of A. These values describe how the matrix stretches, compresses, rotates, or reflects space along special directions called eigenvectors.

For an n × n matrix, the characteristic polynomial has degree n and can be written in the general form

p(λ) = λⁿ + c₁ λⁿ⁻¹ + c₂ λⁿ⁻² + … + cn−1 λ + cn,

where the coefficients ck are built from invariants of the matrix such as the trace and determinant.

Formal Definition in MathML

The definition can also be written using MathML. For an n × n matrix A, the characteristic polynomial is

p ( λ ) = det ( A λ I )

Here, λ is a scalar variable, and I is the identity matrix.

Connection to Eigenvalues

The roots of the characteristic polynomial are precisely the eigenvalues of the matrix. If p(λ) = 0 for some value λ = λ₀, then there exists a nonzero vector v such that A v = λ₀ v. This vector v is an eigenvector associated with the eigenvalue λ₀.

In applications, eigenvalues describe important qualitative features:

The characteristic polynomial is therefore a compact way to encode this eigenvalue information without computing eigenvectors directly.

Formulas for 2×2, 3×3, and 4×4 Matrices

2×2 matrices

For a 2×2 matrix

A = [[a, b], [c, d]],

the characteristic polynomial is

p(λ) = λ² − (tr A) λ + det(A),

where

3×3 matrices

For a 3×3 matrix, the characteristic polynomial has degree three. It can be written as

p(λ) = λ³ − (tr A) λ² + s λ − det(A),

where s is a symmetric expression in the entries of A (related to the sum of principal 2×2 minors or the trace of ). The calculator uses a stable algorithm to compute this coefficient directly from the matrix without requiring you to expand determinants by hand.

4×4 matrices

For a 4×4 matrix, the characteristic polynomial has degree four. The general pattern continues, and the coefficients can be expressed using traces of powers of A and combinations of minors, but the explicit formulas become quite long. Instead of asking you to apply those formulas manually, this calculator uses the Faddeev–Leverrier algorithm to generate them from the matrix entries.

How This Calculator Works

This page supports real-valued 2×2, 3×3, and 4×4 matrices. You select the matrix size, enter the entries, and then the tool computes the characteristic polynomial p(λ) in descending powers of λ.

Internally, the implementation uses the Faddeev–Leverrier algorithm. Very roughly, this algorithm:

Because it works with traces and matrix products, this approach avoids large symbolic determinant expansions and scales well to 4×4 matrices.

Interpreting the Results

After you click Compute Polynomial, the tool returns an expression such as

p(λ) = λ³ − 12 λ² + 47 λ − 60.

You can read this as an ordinary polynomial in the variable λ. Key points when interpreting it include:

The characteristic polynomial alone tells you the eigenvalues (via its roots) but not the eigenvectors. If you need eigenvectors, you will typically combine this result with an eigenvalue or eigenvector calculator.

Worked 3×3 Example

Consider the 3×3 matrix

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

Step 1: Compute the trace and determinant.

Step 2: Form A − λI. This gives

A − λI = [[4 − λ, 2, 0], [1, 3 − λ, 0], [0, 0, 5 − λ]].

Step 3: Compute the determinant det(A − λI). The lower-right block is 1×1, so

det(A − λI) = (5 − λ) det([[4 − λ, 2], [1, 3 − λ]]).

The 2×2 determinant is

(4 − λ)(3 − λ) − 2 × 1 = (12 − 7λ + λ²) − 2 = 10 − 7λ + λ².

Therefore,

p(λ) = det(A − λI) = (5 − λ)(10 − 7λ + λ²).

Expanding and simplifying yields

p(λ) = λ³ − 12 λ² + 47 λ − 60.

The roots of this cubic are λ = 5, λ = 4, and λ = 3, which are exactly the diagonal entries in this example. For a non-triangular matrix, the roots will generally not be visible from the entries, and a calculator like this is especially useful.

Comparison: 2×2 vs 3×3 vs 4×4

The table below summarizes how the characteristic polynomial behaves for the different matrix sizes supported here.

Matrix size Polynomial degree Typical form of p(λ) Trace / determinant relationship Typical use cases
2×2 2 (quadratic) λ² − (tr A) λ + det(A) Coefficient of λ is − tr A; constant term is det(A). Intro linear algebra, simple dynamical systems, 2-state Markov chains.
3×3 3 (cubic) λ³ − (tr A) λ² + s λ − det(A) Coefficient of λ² is − tr A; constant term is − det(A); middle coefficient involves traces and 2×2 minors. Three-dimensional systems, vibration modes, 3-state Markov chains.
4×4 4 (quartic) λ⁴ + c₁ λ³ + c₂ λ² + c₃ λ + c₄ Coefficients c₁, …, c₄ are combinations of traces and minors, computed algorithmically. Small control systems, 4-variable models, compact test cases in numerical linear algebra.

How to Use the Calculator

  1. Select the matrix size (2×2, 3×3, or 4×4) from the Matrix Size menu.
  2. Enter each matrix entry as a decimal number. You can use negative numbers and decimals like -1.5 or 2.75.
  3. Check that all fields are filled for the chosen size. If you change the dimension, the input grid will adjust.
  4. Click Compute Polynomial to generate p(λ).
  5. Optionally use the Copy Result button to paste the polynomial into your notes, reports, or another tool (for example, a root finder or eigenvalue calculator).

The result is displayed in descending powers of λ with coefficients simplified numerically. If any required input is missing or invalid, the calculator will display an error so you can correct it and try again.

Assumptions and Limitations

To keep the tool fast and focused, it makes several assumptions:

If you need exact symbolic expressions (for example, with square roots or rational coefficients), you may want to use a computer algebra system in addition to this numeric calculator.

Who Uses This Calculator?

This tool is designed for:

By automating the most error-prone algebra, the calculator lets you focus on interpreting the eigenvalues and understanding what they mean for your specific problem.

Enter the matrix entries.

Use decimal numbers; leave fields blank if you plan to switch dimensions before calculating.

Embed this calculator

Copy and paste the HTML below to add the Characteristic Polynomial Calculator - Matrix Eigenvalue Tool to your website.