How to use the Cayley-Hamilton Theorem Calculator
- 1. Enter matrix AOne row per line, 2×2, 3×3 or 4×4. Fractions like 1/2 work.
- 2. Optionally pick a powerEnter m to write Aᵐ in terms of lower powers of A.
- 3. Read the workingSee the characteristic equation, A², A³, the zero-matrix check, A⁻¹ and Aᵐ.
What the Cayley-Hamilton theorem says
Every square matrix satisfies its own characteristic equation. If |A − λI| = 0 gives λⁿ + cₙ₋₁λⁿ⁻¹ + … + c₁λ + c₀ = 0, then Aⁿ + cₙ₋₁Aⁿ⁻¹ + … + c₁A + c₀I = 0. For a 3×3 matrix the equation is λ³ − S₁λ² + S₂λ − S₃ = 0, where S₁ is the trace, S₂ the sum of the 2×2 principal minors and S₃ = |A|.
Two uses follow. Multiplying by A⁻¹ gives A⁻¹ = −(1/c₀)(Aⁿ⁻¹ + cₙ₋₁Aⁿ⁻² + … + c₁I), so the inverse needs only powers of A. And any high power Aᵐ can be reduced to a combination of I, A, …, Aⁿ⁻¹ by dividing λᵐ by the characteristic polynomial.
Worked example
Take A = [[2, −1, 1], [−1, 2, −1], [1, −1, 2]]. The trace is 6, the principal minors add to 3 + 3 + 3 = 9 and |A| = 4, so the characteristic equation is λ³ − 6λ² + 9λ − 4 = 0. Computing A² = [[6, −5, 5], [−5, 6, −5], [5, −5, 6]] and A³ = [[22, −21, 21], …] shows A³ − 6A² + 9A − 4I = 0, verifying the theorem.
Then 4A⁻¹ = A² − 6A + 9I = [[3, 1, −1], [1, 3, 1], [−1, 1, 3]], so A⁻¹ = (1/4)[[3, 1, −1], [1, 3, 1], [−1, 1, 3]].
Good to know
If |A| = 0 then c₀ = 0 and A has no inverse, but the theorem still holds. To check the inverse another way, use the Gauss-Jordan calculator; for the roots of the characteristic equation, see the eigenvalue calculator.
Frequently asked questions
How do I verify the Cayley-Hamilton theorem?
Find the characteristic equation, replace λ by A and the constant c by cI, and compute. The result must be the zero matrix.
How is A⁻¹ found from the theorem?
Rearrange Aⁿ + … + c₁A + c₀I = 0 and multiply by A⁻¹: A⁻¹ = −(1/c₀)(Aⁿ⁻¹ + … + c₁I). It needs c₀ = ±|A| to be non-zero.
How does it give high powers like A⁴ or A¹⁰?
Dividing λᵐ by the characteristic polynomial leaves a remainder of degree less than n. The same remainder with A in place of λ equals Aᵐ.
Which sizes are supported?
2×2, 3×3 and 4×4 matrices, with exact fractions throughout.
Is this calculator free?
Yes. You fill a short form once when you see your first result, and other Uncodemy tools then open without the form. Everything is calculated in your browser.