Take a square matrix. Compute its characteristic polynomial — the polynomial whose roots are the eigenvalues, obtained by expanding det(λIA)\det(\lambda I - A). Now do something that looks almost absurd: substitute the matrix AA itself in place of the variable λ\lambda. Where the polynomial used to be a polynomial in a number, it becomes a polynomial in a matrix; each power of λ\lambda becomes a matrix power, each constant term becomes a constant times the identity matrix.

The astonishing claim, made by Arthur Cayley in 1858 and proved in full generality by Ferdinand Frobenius two decades later, is that the result of this substitution is always zero. Every square matrix, of every size, with entries from any field, satisfies its own characteristic polynomial:

pA(A)=0.p_A(A) = 0.

This is the Cayley–Hamilton theorem. It is a strange, clean identity with deep structural consequences. It is one of those facts that looks like a miracle on the surface and turns out to be inevitable once enough of the theory of linear transformations is in place. This article is about what it says, why it works, and what it is good for.

The statement, with 2×22 \times 2 in detail

For a 2×22 \times 2 matrix

A=(abcd),A = \begin{pmatrix} a & b \\ c & d \end{pmatrix},

the characteristic polynomial is

pA(λ)=det(λIA)=(λa)(λd)bc=λ2(a+d)λ+(adbc).p_A(\lambda) = \det(\lambda I - A) = (\lambda - a)(\lambda - d) - bc = \lambda^2 - (a + d)\lambda + (ad - bc).

The two coefficients are recognisable invariants: a+da + d is the trace of AA, and adbcad - bc is the determinant of AA. Cayley–Hamilton says

A2(a+d)A+(adbc)I=0,A^2 - (a + d)A + (ad - bc)I = 0,

where the final II is the 2×22 \times 2 identity matrix. Verify this directly on a concrete example. Take

A=(2134).A = \begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix}.

Its trace is 66, its determinant is 55, so its characteristic polynomial is λ26λ+5\lambda^2 - 6\lambda + 5. Now compute:

A2=(761819),6A=(1261824),5I=(5005).A^2 = \begin{pmatrix} 7 & 6 \\ 18 & 19 \end{pmatrix}, \qquad 6A = \begin{pmatrix} 12 & 6 \\ 18 & 24 \end{pmatrix}, \qquad 5I = \begin{pmatrix} 5 & 0 \\ 0 & 5 \end{pmatrix}.

Subtract and add:

A26A+5I=(712+566+01818+01924+5)=(0000).A^2 - 6A + 5I = \begin{pmatrix} 7 - 12 + 5 & 6 - 6 + 0 \\ 18 - 18 + 0 & 19 - 24 + 5 \end{pmatrix} = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}.

The zero matrix, on the nose. Visually:

Verifying A² − 6A + 5I = 0 for A = [[2,1],[3,4]] A² = ⎛ 7 6 ⎞ ⎝ 18 19 ⎠ 6A = ⎛ 12 6 ⎞ ⎝ 18 24 ⎠ + 5I = ⎛ 5 0 ⎞ ⎝ 0 5 ⎠ = ⎛ 0 0 ⎞ ⎝ 0 0 ⎠ each entry: 7 − 12 + 5 = 0, 6 − 6 + 0 = 0, 18 − 18 + 0 = 0, 19 − 24 + 5 = 0

The same calculation, mutatis mutandis, would have worked for any 2×22 \times 2 matrix, and the analogous calculation works for any square matrix of any size — though for a 5×55 \times 5 matrix the polynomial would have degree 55 and the verification by hand would be tedious.

Why it works: a glimpse

The cleanest way to see why the theorem is true is to first imagine the case where AA is diagonalisable, meaning there is an invertible matrix PP with A=PDP1A = P D P^{-1} for some diagonal matrix DD. The diagonal entries of DD are the eigenvalues λ1,λ2,,λn\lambda_1, \lambda_2, \dots, \lambda_n of AA. The characteristic polynomial factors as

pA(λ)=(λλ1)(λλ2)(λλn),p_A(\lambda) = (\lambda - \lambda_1)(\lambda - \lambda_2) \cdots (\lambda - \lambda_n),

and when this polynomial is evaluated at the diagonal matrix DD, each factor (DλiI)(D - \lambda_i I) has a zero in the ii-th diagonal position. The product of nn diagonal matrices, each with at least one zero on the diagonal in a different position, is the zero matrix. So pA(D)=0p_A(D) = 0, and the identity pA(A)=PpA(D)P1=0p_A(A) = P p_A(D) P^{-1} = 0 follows.

For non-diagonalisable matrices the same idea works once you replace diagonal form with Jordan canonical form, which essentially does the same job up to small upper-triangular perturbations. The full general proof handles either Jordan form directly or uses a more elegant identity involving the adjugate matrix, which sidesteps the eigenvalue picture and applies even over fields where Jordan form is not available. In every approach the underlying reason is the same: the characteristic polynomial vanishes on the eigenvalues of AA, and an eigenvalue-based decomposition is enough to make this vanishing global on AA itself.

Computing high powers cheaply

The theorem has an immediate computational payoff. Suppose you need A1000A^{1000} for a 2×22 \times 2 matrix. Brute force would require nearly a thousand matrix multiplications. Cayley–Hamilton lets you do better. Since A2=(a+d)A(adbc)IA^2 = (a + d)A - (ad - bc)I, every power of AA — including A1000A^{1000} — can be written as αA+βI\alpha A + \beta I for some scalars α\alpha and β\beta. You only need to find those two scalars.

The recursion is straightforward. Let Ak=αkA+βkIA^k = \alpha_k A + \beta_k I. Then multiplying both sides by AA and using the rule A2=(a+d)A(adbc)IA^2 = (a + d)A - (ad - bc)I gives

αk+1=(a+d)αk+βk,βk+1=(adbc)αk.\alpha_{k+1} = (a + d)\alpha_k + \beta_k, \qquad \beta_{k+1} = -(ad - bc)\alpha_k.

A simple two-term recurrence. To get A1000A^{1000} you only need to evolve the two numbers α\alpha and β\beta for a thousand steps — and using fast exponentiation that drops to about 3030 steps. A computation that would have looked like 999999 matrix products is reduced to 3030 pairs of multiplications by Cayley–Hamilton.

The same principle generalises: for an n×nn \times n matrix, every power AkA^k can be expressed as a polynomial of degree less than nn in AA. The infinite series of matrix powers collapses into a finite-dimensional space, and computations that would otherwise grow without bound are tamed by linear algebra alone.

Inverses without elimination

A second use of the theorem is computing inverses. If

pA(λ)=λn+cn1λn1++c1λ+c0,p_A(\lambda) = \lambda^n + c_{n-1}\lambda^{n-1} + \cdots + c_1 \lambda + c_0,

then Cayley–Hamilton says An+cn1An1++c1A+c0I=0A^n + c_{n-1}A^{n-1} + \cdots + c_1 A + c_0 I = 0. Rearranging, AQ(A)=c0IA \cdot Q(A) = -c_0 I where Q(A)=An1+cn1An2++c1IQ(A) = A^{n-1} + c_{n-1}A^{n-2} + \cdots + c_1 I. So when c00c_0 \neq 0 — which means the matrix is invertible — the inverse is

A1=1c0Q(A)=1c0(An1+cn1An2++c1I).A^{-1} = -\frac{1}{c_0}Q(A) = -\frac{1}{c_0}(A^{n-1} + c_{n-1}A^{n-2} + \cdots + c_1 I).

A formula for the inverse as a polynomial in AA. For the 2×22 \times 2 matrix above with pA(λ)=λ26λ+5p_A(\lambda) = \lambda^2 - 6\lambda + 5:

A1=15(A6I)=15(6IA)=15(4132).A^{-1} = -\frac{1}{5}(A - 6I) = \frac{1}{5}(6I - A) = \frac{1}{5}\begin{pmatrix} 4 & -1 \\ -3 & 2 \end{pmatrix}.

This is exactly what the standard 2×22 \times 2 inverse formula gives. For larger matrices the polynomial expression usually involves more arithmetic than Gaussian elimination, but it has the theoretical virtue of expressing A1A^{-1} as an algebraic function of AA alone — a fact that is essential in some abstract settings, particularly when matrices have entries from a commutative ring rather than a field.

What it really tells us

The deep content of Cayley–Hamilton is that the characteristic polynomial annihilates the matrix. Among all the polynomials a matrix satisfies, there is a smallest one, called the minimal polynomial, which always divides the characteristic polynomial. Whether the two are equal, and how their factorisation patterns compare, encodes essentially the entire fine structure of how a linear transformation acts on its underlying vector space — including whether it can be diagonalised, what its Jordan blocks look like, and how it splits the space into invariant subspaces.

The whole industry of normal forms, spectral decompositions, and structure theorems in linear algebra rests on this one identity. A theorem that looks at first like a curious algebraic coincidence — substituting a matrix into a polynomial that was built out of the matrix and getting zero — turns out to be the foundation stone on which the structure of linear operators is built. Eighteen-fifty-eight was a good year for matrices. & 2 \end{pmatrix}.$$

This is exactly what the standard 2×22 \times 2 inverse formula gives. For larger matrices the polynomial expression usually involves more arithmetic than Gaussian elimination, but it has the theoretical virtue of expressing A1A^{-1} as an algebraic function of AA alone — a fact that is essential in some abstract settings, particularly when matrices have entries from a commutative ring rather than a field.

What it really tells us

The deep content of Cayley–Hamilton is that the characteristic polynomial annihilates the matrix. Among all the polynomials a matrix satisfies, there is a smallest one, called the minimal polynomial, which always divides the characteristic polynomial. Whether the two are equal, and how their factorisation patterns compare, encodes essentially the entire fine structure of how a linear transformation acts on its underlying vector space — including whether it can be diagonalised, what its Jordan blocks look like, and how it splits the space into invariant subspaces.

The whole industry of normal forms, spectral decompositions, and structure theorems in linear algebra rests on this one identity. A theorem that looks at first like a curious algebraic coincidence — substituting a matrix into a polynomial that was built out of the matrix and getting zero — turns out to be the foundation stone on which the structure of linear operators is built. Eighteen-fifty-eight was a good year for matrices.

Frequently asked

Who proved Cayley–Hamilton first?

Arthur Cayley announced the result in his 1858 'Memoir on the Theory of Matrices', but he only verified it explicitly for 2×2 and 3×3 cases and acknowledged he had not proved it in general. William Rowan Hamilton had earlier proved the analogous statement for quaternions, which is a special case. The full general proof for arbitrary square matrices is due to Ferdinand Frobenius in 1878. The theorem retained both names because both men contributed important ideas and the credit dispute, unlike some others in 19th-century mathematics, was settled amicably.

Why is the theorem surprising?

Because the characteristic polynomial is derived from the matrix using scalar operations — taking a determinant, evaluating at a scalar variable λ — and there is no a priori reason that substituting the matrix back in should produce zero. For small matrices you can verify it by direct multiplication, but the calculation gives no hint of why the answer comes out to be the zero matrix. The standard proofs require either Jordan canonical form or a clever adjugate identity, neither of which is obvious in advance.

What is the theorem used for?

Three big things. First, computing high powers of a matrix: Cayley–Hamilton lets you express A^n for any n as a polynomial in A of degree less than n, which collapses an n-by-n matrix to at most n stored powers. Second, computing the inverse of an invertible matrix without Gaussian elimination — the inverse can be written as a polynomial in A. Third, theoretical results about minimal polynomials, diagonalisability, and the structure of linear transformations, all of which build on Cayley–Hamilton as a foundation.

Does the theorem hold for non-square matrices?

It does not even make sense for non-square matrices, since the characteristic polynomial is only defined when the determinant det(λI − A) is. A non-square matrix has no determinant, no eigenvalues, no characteristic polynomial, and so nothing to substitute the matrix into. Cayley–Hamilton is intrinsically a statement about square matrices, which is why it sits at the heart of the theory of linear operators on finite-dimensional vector spaces.