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.
The definition can also be written using MathML. For an n × n matrix A, the characteristic polynomial is
Here, is a scalar variable, and is the identity matrix.
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.
For a 2×2 matrix
A = [[a, b], [c, d]],
the characteristic polynomial is
p(λ) = λ² − (tr A) λ + det(A),
where
tr A = a + d is the trace (sum of diagonal entries), anddet(A) = ad − bc is the determinant.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 A²). The calculator uses a stable
algorithm to compute this coefficient directly from the matrix without requiring you to expand determinants by hand.
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.
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:
A.Because it works with traces and matrix products, this approach avoids large symbolic determinant expansions and scales well to 4×4 matrices.
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:
λ) equals the dimension of the matrix. A 2×2 matrix gives a quadratic, a 3×3 gives a cubic, and a 4×4 gives a quartic.
λ is 1, so the polynomial is monic.
λⁿ⁻¹ is (up to a sign) the trace, and the constant term (up to a sign) is the determinant.
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.
Consider the 3×3 matrix
A = [[4, 2, 0], [1, 3, 0], [0, 0, 5]].
Step 1: Compute the trace and determinant.
tr A = 4 + 3 + 5 = 12.det(A) = 4 × 3 × 5 = 60.
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.
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. |
-1.5 or 2.75.p(λ).
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.
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.
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.