What Is The Cayley-Hamilton Theorem?
The Cayley-Hamilton theorem says that every square matrix satisfies its own characteristic equation. In plain terms, if you write down the special polynomial attached to a matrix and then feed the matrix into that polynomial in place of the variable, you get the zero matrix every time.
Two objects make the statement precise. The first is the characteristic polynomial $p(\lambda)$, a polynomial in a variable $\lambda$ built from the matrix. The second is the identity matrix $I$, the matrix version of the number $1$. The theorem then reads:
$$p(A) = O$$
Here $A$ is any square matrix, $p$ is its characteristic polynomial, and $O$ is the zero matrix of the same order. The result holds for a 2 × 2 matrix, a 3 × 3, and every larger square size. It does not apply to rectangular matrices, because only square matrices have a characteristic polynomial in the first place.
What Is The Characteristic Polynomial Of A Matrix?
The characteristic polynomial of a square matrix $A$ is defined as:
$$p(\lambda) = \det(A - \lambda I)$$
You subtract $\lambda$ from each entry on the main diagonal of $A$, leaving every off-diagonal entry unchanged, then take the determinant of the result. Setting $p(\lambda) = 0$ gives the characteristic equation, whose roots are the eigenvalues of the matrix.
For a general 2 × 2 matrix $A = \begin{bmatrix} a & b \ c & d \end{bmatrix}$, the calculation runs like this:
$$A - \lambda I = \begin{bmatrix} a - \lambda & b \ c & d - \lambda \end{bmatrix}$$
$$p(\lambda) = (a - \lambda)(d - \lambda) - bc = \lambda^{2} - (a + d)\lambda + (ad - bc)$$
The coefficient of $\lambda$ is the negative of the trace (the sum of the diagonal entries), and the constant term is the determinant. So for any 2 × 2 matrix the characteristic polynomial is $\lambda^{2} - (\text{trace})\lambda + (\det)$. That compact pattern is what makes the 2 × 2 case the cleanest place to see the theorem work.
How Do You Verify The Cayley-Hamilton Theorem For A 2×2 Matrix?
Take a concrete matrix and check the theorem end to end.
Example 1: Verify the theorem for $A = \begin{bmatrix} 1 & 4 \ 2 & 3 \end{bmatrix}$.
Step 1: Build the characteristic polynomial. The trace is $1 + 3 = 4$ and the determinant is $(1)(3) - (4)(2) = 3 - 8 = -5$.
$$p(\lambda) = \lambda^{2} - 4\lambda - 5$$
Step 2: Write the matrix version. Replace $\lambda^{2}$ with $A^{2}$, replace $-4\lambda$ with $-4A$, and replace the constant $-5$ with $-5I$. The constant becomes a multiple of the identity, never a bare number.
$$p(A) = A^{2} - 4A - 5I$$
Step 3: Compute $A^{2}$.
$$A^{2} = \begin{bmatrix} 1 & 4 \ 2 & 3 \end{bmatrix}\begin{bmatrix} 1 & 4 \ 2 & 3 \end{bmatrix} = \begin{bmatrix} 9 & 16 \ 8 & 17 \end{bmatrix}$$
Step 4: Assemble the three terms.
$$A^{2} - 4A - 5I = \begin{bmatrix} 9 & 16 \ 8 & 17 \end{bmatrix} - \begin{bmatrix} 4 & 16 \ 8 & 12 \end{bmatrix} - \begin{bmatrix} 5 & 0 \ 0 & 5 \end{bmatrix}$$
Subtract entry by entry:
$$p(A) = \begin{bmatrix} 9 - 4 - 5 & 16 - 16 - 0 \ 8 - 8 - 0 & 17 - 12 - 5 \end{bmatrix} = \begin{bmatrix} 0 & 0 \ 0 & 0 \end{bmatrix}$$
Final answer: $p(A) = O$, so $A$ satisfies its own characteristic equation, exactly as the theorem promises.
How Do You Use The Cayley-Hamilton Theorem To Find A Matrix Inverse?
The theorem is not only a curiosity to be verified. It gives a fast route to the inverse of a matrix, because the characteristic equation already links $A$, the identity, and the powers of $A$.
Start from the equation you proved above:
$$A^{2} - 4A - 5I = O$$
Move the identity term to one side, then factor a single $A$ out of the remaining terms:
$$A^{2} - 4A = 5I \quad\Longrightarrow\quad A(A - 4I) = 5I$$
Divide by $5$ and read off what multiplies $A$ to give the identity:
$$A \cdot \tfrac{1}{5}(A - 4I) = I \quad\Longrightarrow\quad A^{-1} = \tfrac{1}{5}(A - 4I)$$
Now substitute the actual matrix:
$$A^{-1} = \tfrac{1}{5}\left(\begin{bmatrix} 1 & 4 \ 2 & 3 \end{bmatrix} - \begin{bmatrix} 4 & 0 \ 0 & 4 \end{bmatrix}\right) = \tfrac{1}{5}\begin{bmatrix} -3 & 4 \ 2 & -1 \end{bmatrix} = \begin{bmatrix} -\tfrac{3}{5} & \tfrac{4}{5} \ \tfrac{2}{5} & -\tfrac{1}{5} \end{bmatrix}$$
Final answer: $A^{-1} = \begin{bmatrix} -\tfrac{3}{5} & \tfrac{4}{5} \ \tfrac{2}{5} & -\tfrac{1}{5} \end{bmatrix}$. This matches the standard $\frac{1}{ad-bc}\begin{bmatrix} d & -b \ -c & a \end{bmatrix}$ formula, which is a useful sanity check. The method works whenever the constant term of the characteristic polynomial is non-zero, and that constant is exactly the determinant, so the inverse exists precisely when $\det(A) \neq 0$.
How Do You Find Higher Powers Of A Matrix With The Theorem?
Raising a matrix to a large power by repeated multiplication is slow and error-prone. The Cayley-Hamilton theorem collapses the work, because it lets you rewrite the highest power in terms of lower ones.
Rearrange the characteristic equation to isolate $A^{2}$:
$$A^{2} - 4A - 5I = O \quad\Longrightarrow\quad A^{2} = 4A + 5I$$
Every power from here on reduces to a combination of $A$ and $I$. To get $A^{3}$, multiply both sides by $A$ and substitute the line above wherever $A^{2}$ appears:
$$A^{3} = A \cdot A^{2} = A(4A + 5I) = 4A^{2} + 5A = 4(4A + 5I) + 5A = 21A + 20I$$
Substituting the numbers gives $A^{3} = 21\begin{bmatrix} 1 & 4 \ 2 & 3 \end{bmatrix} + 20I = \begin{bmatrix} 41 & 84 \ 42 & 83 \end{bmatrix}$, which agrees with computing $A^{3}$ the long way. The same trick scales: any power $A^{n}$ of a 2 × 2 matrix can be written as $\alpha A + \beta I$ for two numbers, no matter how large $n$ grows.
How Does The Cayley-Hamilton Theorem Work For A 3×3 Matrix?
The idea is identical for larger matrices; only the polynomial grows. For a 3 × 3 matrix, the characteristic polynomial has degree three:
$$p(\lambda) = \lambda^{3} - (\text{trace})\lambda^{2} + (M)\lambda - \det(A)$$
Here $M$ is the sum of the three principal 2 × 2 minors of $A$. The theorem then states $A^{3} - (\text{trace})A^{2} + M,A - \det(A),I = O$.
Take the diagonal matrix $A = \begin{bmatrix} 1 & 0 & 0 \ 0 & 2 & 0 \ 0 & 0 & 3 \end{bmatrix}$. Its trace is $6$, its determinant is $6$, and the sum of principal 2 × 2 minors is $(1)(2) + (1)(3) + (2)(3) = 11$, giving:
$$p(\lambda) = \lambda^{3} - 6\lambda^{2} + 11\lambda - 6$$
Substituting $A$ and checking the top-left entry alone shows the pattern: $1^{3} - 6(1^{2}) + 11(1) - 6 = 1 - 6 + 11 - 6 = 0$. The middle and bottom diagonal entries give $8 - 24 + 22 - 6 = 0$ and $27 - 54 + 33 - 6 = 0$, so $p(A) = O$ once again.
Why Does Every Matrix Satisfy Its Own Equation?
The theorem can feel like a coincidence at first. It is not. Two ideas explain why it has to be true.
The eigenvalue view. The roots of the characteristic polynomial are the eigenvalues of the matrix. Each eigenvalue is a value the matrix "acts like" along a certain direction, so plugging the matrix into a polynomial that vanishes at all of those values sends every direction to zero at once. The whole matrix, built from those directions, is annihilated.
The linear-dependence view. An $n \times n$ matrix cannot have more than $n$ genuinely independent powers. Sooner or later $I, A, A^{2}, \dots, A^{n}$ must be linked by one linear relation, and the characteristic polynomial is exactly the relation that appears. That is why $A^{n}$ always folds back into lower powers.
A tempting shortcut, "just put $A$ into $\det(A - \lambda I)$ to get $\det(A - A) = \det(O) = 0$", looks like a proof but is not one. It replaces a scalar variable with a matrix inside a determinant, mixing two different kinds of object, and it lands on the number $0$ rather than the zero matrix. The genuine reasons are the two views above, and both say the same thing: a matrix carries its own equation inside it.
Who Discovered The Cayley-Hamilton Theorem?
The result carries two names, and the story behind the first one is a small lesson in how mathematics actually grows.
Two figures give the theorem its double-barrelled name:
Arthur Cayley (1821–1895, England) stated the theorem in 1858 and founded much of the modern algebra of matrices, including the rules for adding, multiplying, and inverting them.
William Rowan Hamilton (1805–1865, Ireland) had earlier established an equivalent result for the four-dimensional case that arose from his work on quaternions, which is why his name is attached alongside Cayley's.
Where Is The Cayley-Hamilton Theorem Used In The Real World?
The theorem is a workhorse wherever powers, inverses, or functions of a matrix appear.
Control engineering: the stability and controllability of a system are read from powers of its state matrix, and the theorem bounds how many powers you ever need to check.
Computer graphics and robotics: repeated transformations compound as matrix powers, and reducing high powers to low ones keeps animation and motion-planning calculations fast.
Numerical computing: functions of a matrix, such as the matrix exponential used to solve systems of differential equations, are computed by expressing them through a finite set of low powers.
Signal processing and dynamics: recurrence relations and discrete-time models advance by multiplying by a matrix repeatedly, where the theorem turns a growing chain of powers into a fixed, short formula.
One compact fact, that a matrix obeys its own equation, quietly shortens calculations across engineering, graphics, and applied mathematics alike.
What Are The Most Common Cayley-Hamilton Theorem Mistakes?
Three errors account for most lost marks on this topic. Each one is easy to avoid once you have seen it named.
Slipping on the sign or the identity when forming $\det(A - \lambda I)$.
Where it slips in:
A student subtracts $\lambda$ from only one diagonal entry, or subtracts the plain number $\lambda$ from the whole matrix instead of the matrix $\lambda I$.
Don't do this:
Do not treat $\lambda$ as something you sprinkle onto a single entry, and do not forget that it is really $\lambda I$ being subtracted.
The correct way:
Subtract $\lambda$ from every entry on the main diagonal and leave the off-diagonal entries untouched, since $A - \lambda I$ only changes the diagonal.
Substituting a scalar into $p$ instead of the matrix.
Where it slips in:
A student computes $p(\lambda)$ as an ordinary number for some value and sets that equal to zero, treating the theorem as if it were about numbers.
Don't do this:
Do not plug a scalar into the characteristic polynomial and stop there. The theorem is a statement about the matrix, not about a number.
The correct way:
Replace the variable $\lambda$ with the matrix $A$ throughout, so $\lambda^{2}$ becomes $A^{2}$, $\lambda$ becomes $A$, and the equation is an equality of matrices.
Forgetting that the constant term becomes $cI$.
Where it slips in:
When rewriting $p(\lambda)$ as $p(A)$, a student keeps the constant term as a bare number, writing $A^{2} - 4A - 5$ instead of $A^{2} - 4A - 5I$.
Don't do this:
Do not subtract a scalar from a matrix. A number and a matrix cannot be added or subtracted directly.
The correct way:
Turn every constant $c$ into $cI$, a scalar multiple of the identity matrix, so that all three terms are matrices of the same order and can be combined.
Practice Problems On The Cayley-Hamilton Theorem
Work each one, then check against the answer that follows.
Write the characteristic polynomial of $A = \begin{bmatrix} 2 & 1 \ 0 & 3 \end{bmatrix}$.
(Answer: trace $=5$, determinant $=6$, so $p(\lambda) = \lambda^{2} - 5\lambda + 6$.)Verify the Cayley-Hamilton theorem for $A = \begin{bmatrix} 2 & 1 \ 0 & 3 \end{bmatrix}$.
(Answer: $A^{2} = \begin{bmatrix} 4 & 5 \ 0 & 9 \end{bmatrix}$, and $A^{2} - 5A + 6I = O$.)Use the theorem to find $A^{-1}$ for the same $A$.
(Answer: from $A^{2} - 5A + 6I = O$, $A^{-1} = \tfrac{1}{6}(5I - A) = \begin{bmatrix} \tfrac{1}{2} & -\tfrac{1}{6} \ 0 & \tfrac{1}{3} \end{bmatrix}$.)Express $A^{2}$ as a linear combination of $A$ and $I$ for $B = \begin{bmatrix} 0 & 1 \ -2 & -3 \end{bmatrix}$.
(Answer: $p(\lambda) = \lambda^{2} + 3\lambda + 2$, so $B^{2} = -3B - 2I$.)Find $B^{3}$ for the matrix in problem 4 using the theorem.
(Answer: $B^{3} = B \cdot B^{2} = -3B^{2} - 2B = -3(-3B - 2I) - 2B = 7B + 6I$.)State the characteristic polynomial of the 3 × 3 diagonal matrix with diagonal entries $2, 4, 5$. (Answer: $p(\lambda) = (\lambda - 2)(\lambda - 4)(\lambda - 5) = \lambda^{3} - 11\lambda^{2} + 38\lambda - 40$.)
Where Should You Go Next After The Cayley-Hamilton Theorem?
This theorem sits at a crossroads in matrix algebra, and several natural paths open from here.
Eigenvalues. The roots of the characteristic equation are the eigenvalues, the numbers that unlock diagonalisation and the deeper structure of a matrix.
Determinant of a matrix. The constant term of the characteristic polynomial is the determinant, so a firm grip here makes the whole theorem clearer.
Matrices and determinants. A wider tour of the topic, from the order of a matrix up to solving systems of equations.
A live Bhanzu trainer teaches these connections in sequence, starting from the "why" behind each rule, in the Bhanzu algebra program.
Was this article helpful?
Your feedback helps us write better content
