Linear Algebra

Characteristic Polynomial Calculator

Enter a 2×2, 3×3, or 4×4 matrix to compute det(λI − A) with full step-by-step working. Shows cofactor expansion, eigenvalues, trace, determinant, and principal minors.

characteristic-polynomial-calculator
Matrix A — diagonal cells highlighted

What is the Characteristic Polynomial?

The characteristic polynomial of a square n×n matrix A is the polynomial obtained by computing the determinant of (λI − A), where λ is a scalar variable and I is the n×n identity matrix. It is always a monic polynomial of degree n — the leading coefficient (of λⁿ) is always 1 — and its roots are exactly the eigenvalues of A.

The polynomial encodes the most important spectral information about the matrix. Its coefficients are expressible in terms of elementary symmetric polynomials of the eigenvalues: the coefficient of λⁿ⁻¹ is always −tr(A) (minus the trace), and the constant term is (−1)ⁿ det(A). The intermediate coefficients involve sums of principal minors of increasing size. For a 3×3 matrix, the coefficient of λ is the sum of the three 2×2 principal minors; for a 4×4 matrix, the coefficient of λ involves all 3×3 principal minors.

General definition: p(λ) = det(λI − A) Properties of p(λ): • Monic of degree n (leading term λⁿ) • Coefficient of λⁿ⁻¹ = −tr(A) • Constant term = (−1)ⁿ det(A) • Roots of p(λ) = eigenvalues of A • p(A) = 0 (Cayley-Hamilton theorem)

Characteristic Polynomial of a 2×2 Matrix

For a 2×2 matrix, the formula reduces to a simple quadratic involving only the trace and determinant:

A = |a b| p(λ) = λ² − tr(A)·λ + det(A) |c d| tr(A) = a + d (sum of diagonal) det(A) = ad − bc Derivation: det(λI − A) = det|λ−a −b | |−c λ−d| = (λ−a)(λ−d) − (−b)(−c) = λ² − dλ − aλ + ad − bc = λ² − (a+d)λ + (ad−bc) Eigenvalues (quadratic formula): λ = [tr(A) ± √(tr(A)² − 4·det(A))] / 2

Example — A = [[4, 2], [1, 3]]: tr = 7, det = 10, so p(λ) = λ² − 7λ + 10 = (λ−5)(λ−2). Eigenvalues: λ₁ = 5, λ₂ = 2.

Characteristic Polynomial of a 3×3 Matrix

For a 3×3 matrix, the characteristic polynomial is a cubic involving the trace, the sum of 2×2 principal minors (M₂), and the determinant:

A = |a b c| p(λ) = λ³ − tr(A)·λ² + M₂·λ − det(A) |d e f| |g h i| tr(A) = a + e + i M₂ = sum of 2×2 principal minors: M₁₁ = det|e f| = ei − fh (remove row 1, col 1) |h i| M₂₂ = det|a c| = ai − cg (remove row 2, col 2) |g i| M₃₃ = det|a b| = ae − bd (remove row 3, col 3) |d e| M₂ = M₁₁ + M₂₂ + M₃₃ det(A) = a(ei−fh) − b(di−fg) + c(dh−eg)

Characteristic Polynomial of a 4×4 Matrix

For a 4×4 matrix, the characteristic polynomial is degree 4 with coefficients involving all principal minors up to size 3:

p(λ) = λ⁴ − c₃λ³ + c₂λ² − c₁λ + c₀ c₃ = tr(A) c₂ = sum of all 2×2 principal minors (there are 6 of them, C(4,2)) c₁ = sum of all 3×3 principal minors (there are 4 of them, C(4,3)) c₀ = det(A) The 4×4 determinant is found by cofactor expansion along any row or column, reducing it to four 3×3 determinant calculations — each of which is then itself expanded by cofactor expansion.

For hand calculation of 4×4 matrices, cofactor expansion along a row with many zeros significantly reduces work. Row reduction (Gaussian elimination on λI − A, tracking the determinant factor) is another practical approach for numerical values.

Cofactor Expansion — How the Determinant Is Computed

Cofactor expansion (also called Laplace expansion) expresses the determinant of an n×n matrix as a signed sum of n minors of size (n−1)×(n−1). Expanding along row 1:

det(M) = Σⱼ (−1)^(1+j) · m₁ⱼ · det(M_1j) where m₁ⱼ is the (1,j) entry and M_1j is the matrix with row 1 and column j removed. The sign pattern along row 1 is: +, −, +, −, ... (The full checkerboard sign matrix has (−1)^(i+j) at position (i,j).) For the characteristic polynomial, each entry m₁ⱼ of λI−A is itself a polynomial in λ (degree 1 on the diagonal, degree 0 off the diagonal), and each minor det(M_1j) is a polynomial of degree n−1 in λ. The product m₁ⱼ · det(M_1j) yields a polynomial of degree at most n, and summing all n such products gives p(λ) of degree exactly n.

Minimal Polynomial

The minimal polynomial m(λ) of a matrix A is the monic polynomial of smallest degree satisfying m(A) = 0. While the characteristic polynomial always has degree n (the matrix size), the minimal polynomial can have lower degree.

Key relationships between the two polynomials:

• m(λ) divides p(λ) • p(λ) and m(λ) have the same set of irreducible factors (same roots, but possibly different multiplicities) • For diagonalizable matrices: m(λ) = product of distinct linear factors • For the identity matrix I_n: p(λ) = (λ−1)ⁿ, m(λ) = (λ−1) • For a Jordan block J_n(α): p(λ) = (λ−α)ⁿ = m(λ) Finding the minimal polynomial: 1. Find p(λ) and factorise it. 2. For each prime power factor (λ−αᵢ)^kᵢ in p(λ), find the smallest power mᵢ ≤ kᵢ such that (A−αᵢI)^mᵢ = 0 block-wise. 3. m(λ) = product of (λ−αᵢ)^mᵢ.

Eigenvalues and What the Characteristic Polynomial Reveals

Quantity Location in p(λ) Formula
EigenvaluesRoots of p(λ)p(λ₀) = 0 ↔ Av = λ₀v for some v ≠ 0
TraceCoefficient of −λⁿ⁻¹tr(A) = λ₁ + λ₂ + … + λₙ
DeterminantConstant term × (−1)ⁿdet(A) = λ₁ × λ₂ × … × λₙ
Algebraic multiplicityMultiplicity of rootIf (λ−α)ᵏ divides p(λ), α has algebraic mult. k
Rank deficiencyλ=0 is a rootp(0) = 0 ↔ det(A) = 0 ↔ A is singular
Sum of squares of eigenvaluesNot directly — needs tr(A²)tr(A²) = λ₁² + … + λₙ²

Numerical eigenvalue finding

For 2×2 matrices, the quadratic formula gives exact eigenvalues. For 3×3, Cardano's formula gives exact roots but they are often expressed as complex cube roots of real numbers, making numerical evaluation more practical. For 4×4 and above, Ferrari's quartic formula exists but is rarely used — iterative numerical methods (QR algorithm, power iteration, companion matrix methods) are standard. This calculator uses Newton-Raphson root finding with polynomial deflation for 3×3 and 4×4 matrices.

Applications of the Characteristic Polynomial

Application How the characteristic polynomial is used
Eigenvalue analysisFinding eigenvalues of small matrices; verifying numerical eigenvalue calculations
Stability of dynamical systemsThe eigenvalues of the system matrix determine whether a linear system converges or diverges. Location of roots relative to the unit circle (discrete) or imaginary axis (continuous) gives stability.
Cayley-Hamilton applicationsExpressing high matrix powers as linear combinations of lower powers; computing A⁻¹ without Gauss-Jordan by expressing it from the characteristic polynomial
DiagonalisationIf p(λ) has n distinct roots, A is diagonalisable. If roots are repeated, the minimal polynomial determines whether diagonalisation is possible.
Control theoryCharacteristic polynomial of the system matrix determines pole locations; pole placement design specifies a target characteristic polynomial
Graph theoryCharacteristic polynomial of the adjacency matrix encodes graph properties: number of closed walks, graph isomorphism testing
Structural analysis (FEM)Natural frequencies of structures are eigenvalues of K M⁻¹ where K is the stiffness matrix and M is the mass matrix — found via their characteristic polynomial

Common Questions

  • The characteristic polynomial of a square matrix A is the polynomial p(λ) = det(λI − A), where λ is a scalar variable, I is the identity matrix of the same size, and det denotes the determinant. It is a degree-n polynomial in λ for an n×n matrix, and its roots are precisely the eigenvalues of A. The characteristic polynomial encodes fundamental information about the matrix: its constant term equals (−1)ⁿ det(A), its leading coefficient is always 1 (monic), and the coefficient of λⁿ⁻¹ equals minus the trace of A.
  • For a 2×2 matrix A with entries a, b, c, d (row-major), the characteristic polynomial is p(λ) = λ² − tr(A)λ + det(A), where tr(A) = a + d (the trace) and det(A) = ad − bc. This shortcut comes directly from expanding det(λI − A): the (1,1) entry is λ−a, the (2,2) entry is λ−d, and expanding gives (λ−a)(λ−d) − (−b)(−c) = λ² − (a+d)λ + (ad−bc).
  • For a 3×3 matrix, p(λ) = λ³ − tr(A)λ² + M₂λ − det(A), where tr(A) is the sum of diagonal entries, M₂ is the sum of the three 2×2 principal minors (M₁₁ = ei−fh, M₂₂ = ai−cg, M₃₃ = ae−bd for entries a through i), and det(A) is the full 3×3 determinant. The full derivation requires cofactor expansion of det(λI − A) along any row or column, which this calculator shows step by step.
  • The eigenvalues of a matrix A are exactly the roots of its characteristic polynomial p(λ). If p(λ₀) = 0, then det(λ₀I − A) = 0, which means (λ₀I − A) is singular, so there exists a non-zero vector v satisfying Av = λ₀v — the definition of an eigenvector with eigenvalue λ₀. For a real matrix, complex eigenvalues appear in conjugate pairs. By the Cayley-Hamilton theorem, every square matrix satisfies its own characteristic equation: p(A) = 0.
  • The minimal polynomial of A is the monic polynomial of lowest degree m(λ) such that m(A) = 0. Every factor of the minimal polynomial also divides the characteristic polynomial, and they share the same irreducible factors (same roots, possibly with different multiplicities). The characteristic polynomial has degree equal to the matrix size n; the minimal polynomial has degree at most n. For diagonalizable matrices, the minimal polynomial has no repeated roots. For a matrix with one distinct eigenvalue, the minimal polynomial and characteristic polynomial may differ: for example, the 3×3 identity matrix has characteristic polynomial (λ−1)³ but minimal polynomial (λ−1).
  • The Cayley-Hamilton theorem states that every square matrix satisfies its own characteristic equation. If p(λ) = λⁿ + cₙ₋₁λⁿ⁻¹ + … + c₁λ + c₀ is the characteristic polynomial of A, then p(A) = Aⁿ + cₙ₋₁Aⁿ⁻¹ + … + c₁A + c₀I = 0, the zero matrix. This has practical applications: it provides a way to express any power of A as a linear combination of lower powers, to compute A⁻¹ (for invertible A), and to find the minimal polynomial by factoring the characteristic polynomial.
  • This calculator shows the full step-by-step working — cofactor expansion, minor evaluations, polynomial multiplication, and term collection — which Wolfram Alpha does not display by default. It explicitly shows how (λI − A) is constructed, how the determinant is expanded along the first row, how each 2×2 or 3×3 minor is evaluated as a polynomial, and how the terms are combined into the final characteristic polynomial. It also shows eigenvalues numerically and the key matrix invariants (trace, determinant, principal minors) that appear as coefficients.
  • If the matrix A has real entries, the characteristic polynomial always has real coefficients — since the formula p(λ) = det(λI − A) only involves real arithmetic applied to real entries and the variable λ. Complex eigenvalues can still arise as roots: they appear as conjugate pairs, and the corresponding quadratic factors have real coefficients. If A has complex entries, the characteristic polynomial will generally have complex coefficients, but it remains monic of degree n.