Computing Library › Linear Algebra
Linear Algebra

The Characteristic Polynomial

The degree-n polynomial whose roots are a matrix's eigenvalues, encoding trace, determinant, and spectrum.

Definition

The characteristic polynomial of an n-by-n matrix A is p(lambda) = det(A - lambda I). Expanding this determinant gives a polynomial of degree n in lambda. Its roots are exactly the eigenvalues of A, counted with algebraic multiplicity, so the polynomial packages the entire spectrum into a single expression.

Coefficients carry meaning

The coefficients of the characteristic polynomial are the elementary symmetric functions of the eigenvalues. The leading term is plus or minus lambda^n; the next coefficient is minus the trace; the constant term is the determinant (up to sign). Thus trace and determinant are just two of the n invariants hidden in this polynomial.

Algebraic versus geometric multiplicity

An eigenvalue's algebraic multiplicity is its multiplicity as a root of the characteristic polynomial. Its geometric multiplicity is the number of independent eigenvectors it has. The geometric never exceeds the algebraic; when they differ the matrix is defective and cannot be diagonalized, requiring the Jordan form instead.

Cayley-Hamilton theorem

A matrix satisfies its own characteristic equation: substituting A for lambda gives p(A) = 0, the zero matrix. This remarkable fact lets you express high powers of A, and even A^{-1}, in terms of lower powers, and it underlies methods for computing matrix functions.

A numerical warning

Although elegant, finding eigenvalues by explicitly forming and rooting the characteristic polynomial is numerically unstable; small coefficient errors move roots wildly. Practical eigenvalue software uses iterative methods such as the QR algorithm that never form the polynomial at all.

python
import numpy as np
A = np.array([[2.0, 1.0], [1.0, 2.0]])
print(np.poly(A))   # coefficients: [1. -4. 3.] -> lambda^2 - 4 lambda + 3

The Cayley-Hamilton relation makes this polynomial a practical tool: it reduces any matrix power to a combination of I, A, up to A^{n-1}, which is how compact recurrences for matrix functions and powers are derived.