Characteristic Polynomial Calculator
Calculate the characteristic polynomial, coefficients, and eigenvalues of any square matrix up to 6×6. Uses the Faddeev - LeVerrier algorithm.
About
The characteristic polynomial of a square matrix A encodes its eigenvalues as roots. Miscalculating it propagates errors into stability analysis, control system design, and principal component extraction. This tool computes det(λI − A) using the Faddeev - LeVerrier algorithm, which recovers all n + 1 coefficients in O(n4) operations without symbolic expansion. Results are exact for integer entries and IEEE-754 accurate for decimal entries. The tool handles matrices from 1×1 up to 6×6.
Limitation: floating-point rounding may affect coefficients for ill-conditioned matrices with entries exceeding 108. For matrices up to 3×3, eigenvalues are computed analytically. For 4×4 and above, eigenvalues are approximated numerically via QR iteration on the companion matrix. Pro tip: verify results by checking that the sum of eigenvalues equals tr(A) and their product equals det(A).
Formulas
The characteristic polynomial of an n × n matrix A is defined as:
The Faddeev - LeVerrier algorithm computes the coefficients iteratively. Starting with M0 = 0 (zero matrix), at each step k = 1, 2, …, n:
Where p(λ) is the characteristic polynomial, λ is the eigenvalue parameter, I is the n × n identity matrix, A is the input square matrix, ck are the polynomial coefficients, tr() denotes the matrix trace (sum of diagonal elements), det() denotes the determinant, and Mk are intermediate matrices in the recurrence. The leading coefficient of λn is always 1 (monic polynomial).
Reference Data
| Matrix Size | Polynomial Degree | Coefficients Count | Faddeev - LeVerrier Steps | Analytical Roots | Common Applications |
|---|---|---|---|---|---|
| 1×1 | 1 | 2 | 1 | Direct | Scalar eigenvalue |
| 2×2 | 2 | 3 | 2 | Quadratic formula | 2D transformations, coupled oscillators |
| 3×3 | 3 | 4 | 3 | Cardano's method | 3D rotations, stress tensors |
| 4×4 | 4 | 5 | 4 | Numerical (QR) | Spacetime metrics, control systems |
| 5×5 | 5 | 6 | 5 | Numerical (QR) | Quantum mechanics, graph Laplacians |
| 6×6 | 6 | 7 | 6 | Numerical (QR) | Finite element analysis, PCA |
| Key Relationships | |||||
| cn−1 | −tr(A) (negative trace) | ||||
| c0 | (−1)n det(A) | ||||
| Cayley - Hamilton | p(A) = 0 (matrix satisfies its own polynomial) | ||||
| Vieta's formulas | λ1 + … + λn = tr(A) | ||||
| Determinant | λ1 ⋅ … ⋅ λn = det(A) | ||||
| Similar matrices | Share the same characteristic polynomial | ||||
| Symmetric real matrix | All eigenvalues are real | ||||
| Orthogonal matrix | All eigenvalues have |λ| = 1 | ||||
| Nilpotent matrix | p(λ) = λn | ||||
| Identity matrix In | p(λ) = (λ − 1)n | ||||