Tutorials › Linear Algebra › Using Cayley–Hamilton to Reduce Powers

Invariant Subspaces and Cayley-Hamilton · Tutorial 577 of 1000

Using Cayley–Hamilton to Reduce Powers

Learn how Cayley–Hamilton gives a recurrence for matrix powers, then apply and verify that recurrence in exact examples.

Advanced 10 min read

What You'll Learn

  • Read the Cayley–Hamilton relation in the course’s characteristic-polynomial convention
  • Derive a recurrence expressing each sufficiently high power in terms of lower powers
  • Reduce polynomial expressions in a square matrix to powers below its size
  • Track coefficients carefully when iterating the recurrence
  • Verify reduced powers by direct matrix multiplication
  • Recognize why a reduced expression need not be unique

From a Polynomial Identity to a Power Recurrence

A direct computation of \(\mathbf{A}^k\) requires multiplying the matrix repeatedly, and the entries can grow quickly. For a square matrix, the Cayley–Hamilton theorem provides another route: a polynomial equation satisfied by \(\mathbf{A}\) can be rearranged to express one power in terms of lower powers. Repeating that replacement reduces any high power to a combination of a fixed, finite list of powers.

Throughout, \(\mathbf{A}\in\mathbb{R}^{n\times n}\), where \(n\geq 1\). The same arguments hold over \(\mathbb{C}\). For a polynomial \(f(\lambda)=a_0+a_1\lambda+\cdots+a_m\lambda^m\), its evaluation at \(\mathbf{A}\) means \(f(\mathbf{A})=a_0\mathbf{I}_n+a_1\mathbf{A}+\cdots+a_m\mathbf{A}^m\). In particular, the constant term becomes a multiple of the identity matrix, not a multiple of the zero matrix.

We use the convention \(p_{\mathbf{A}}(\lambda)=\det(\mathbf{A}-\lambda\mathbf{I}_n)\). Write its coefficients as

$$ p_{\mathbf{A}}(\lambda) =(-1)^n\left(\lambda^n+\gamma_{n-1}\lambda^{n-1} +\cdots+\gamma_1\lambda+\gamma_0\right). $$

The Cayley–Hamilton theorem states that \(p_{\mathbf{A}}(\mathbf{A})=\mathbf{O}\). This theorem, including its proof, was established in the earlier material on Cayley–Hamilton. Since multiplication by the nonzero scalar \((-1)^n\) does not change a zero matrix equation, substituting \(\mathbf{A}\) into the displayed polynomial gives

$$ \mathbf{A}^n+\gamma_{n-1}\mathbf{A}^{n-1} +\cdots+\gamma_1\mathbf{A}+\gamma_0\mathbf{I}_n=\mathbf{O}. $$
Theorem (Power recurrence): Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) have characteristic polynomial \(p_{\mathbf{A}}(\lambda)=(-1)^n(\lambda^n+\gamma_{n-1}\lambda^{n-1}+\cdots+\gamma_0)\). For every integer \(k\geq n\), $$ \mathbf{A}^k=-\gamma_{n-1}\mathbf{A}^{k-1}-\cdots-\gamma_1\mathbf{A}^{k-n+1}-\gamma_0\mathbf{A}^{k-n}. $$

Proof. By Cayley–Hamilton, \(\mathbf{A}^n+\gamma_{n-1}\mathbf{A}^{n-1}+\cdots+\gamma_0\mathbf{I}_n=\mathbf{O}\). For \(k\geq n\), multiply this equation on the right by \(\mathbf{A}^{k-n}\). Matrix multiplication distributes over addition, and \(\mathbf{A}^i\mathbf{A}^{k-n}=\mathbf{A}^{i+k-n}\). The resulting equation is \(\mathbf{A}^k+\gamma_{n-1}\mathbf{A}^{k-1}+\cdots+\gamma_0\mathbf{A}^{k-n}=\mathbf{O}\). Moving all but the first term to the right gives the stated recurrence. \(\square\)

The recurrence starts at \(k=n\); its final term is then \(\mathbf{A}^0=\mathbf{I}_n\). Each later application replaces a power by terms with smaller exponents. The coefficients do not change from one step to another, but the powers do, so it is important to update every exponent carefully.

Reducing Powers Step by Step

Worked Example: Reducing the Fifth Power of a Two-by-Two Matrix

Let \(\mathbf{A}=\begin{bmatrix}1&1\\0&2\end{bmatrix}\). Find \(\mathbf{A}^5\) as a combination of \(\mathbf{A}\) and \(\mathbf{I}_2\), using Cayley–Hamilton, and verify the result by multiplication.

The characteristic polynomial in the stated convention is

$$ p_{\mathbf{A}}(\lambda) =\det\begin{bmatrix}1-\lambda&1\\0&2-\lambda\end{bmatrix} =(1-\lambda)(2-\lambda) =\lambda^2-3\lambda+2. $$

Cayley–Hamilton therefore gives \(\mathbf{A}^2-3\mathbf{A}+2\mathbf{I}_2=\mathbf{O}\), or \(\mathbf{A}^2=3\mathbf{A}-2\mathbf{I}_2\). Applying this identity repeatedly, keeping each substitution visible, gives

$$ \begin{aligned} \mathbf{A}^3 &=3\mathbf{A}^2-2\mathbf{A} =3(3\mathbf{A}-2\mathbf{I}_2)-2\mathbf{A} =7\mathbf{A}-6\mathbf{I}_2,\\ \mathbf{A}^4 &=7\mathbf{A}^2-6\mathbf{A} =7(3\mathbf{A}-2\mathbf{I}_2)-6\mathbf{A} =15\mathbf{A}-14\mathbf{I}_2,\\ \mathbf{A}^5 &=15\mathbf{A}^2-14\mathbf{A} =15(3\mathbf{A}-2\mathbf{I}_2)-14\mathbf{A} =31\mathbf{A}-30\mathbf{I}_2. \end{aligned} $$

Now \(31\mathbf{A}-30\mathbf{I}_2=\begin{bmatrix}1&31\\0&32\end{bmatrix}\). To check by direct multiplication, first compute \(\mathbf{A}^2=\begin{bmatrix}1&3\\0&4\end{bmatrix}\), then \(\mathbf{A}^3=\begin{bmatrix}1&7\\0&8\end{bmatrix}\), and \(\mathbf{A}^4=\begin{bmatrix}1&15\\0&16\end{bmatrix}\). Thus

$$ \mathbf{A}^5=\mathbf{A}^4\mathbf{A} =\begin{bmatrix}1&15\\0&16\end{bmatrix} \begin{bmatrix}1&1\\0&2\end{bmatrix} =\begin{bmatrix}1&31\\0&32\end{bmatrix}, $$

which agrees with the reduction.

For a two-by-two matrix, the recurrence always replaces powers of degree at least two by combinations of \(\mathbf{I}_2\) and \(\mathbf{A}\). A repeated root in the characteristic polynomial does not prevent the reduction: Cayley–Hamilton applies whether the roots are distinct or repeated.

Worked Example: A Repeated Root

Let \(\mathbf{B}=\begin{bmatrix}2&1\\0&2\end{bmatrix}\). Reduce \(\mathbf{B}^4\) using Cayley–Hamilton and check it by multiplication.

Here \(p_{\mathbf{B}}(\lambda)=(2-\lambda)^2=\lambda^2-4\lambda+4\). Thus \(\mathbf{B}^2=4\mathbf{B}-4\mathbf{I}_2\), and the next two reductions are

$$ \begin{aligned} \mathbf{B}^3 &=4\mathbf{B}^2-4\mathbf{B} =4(4\mathbf{B}-4\mathbf{I}_2)-4\mathbf{B} =12\mathbf{B}-16\mathbf{I}_2,\\ \mathbf{B}^4 &=12\mathbf{B}^2-16\mathbf{B} =12(4\mathbf{B}-4\mathbf{I}_2)-16\mathbf{B} =32\mathbf{B}-48\mathbf{I}_2. \end{aligned} $$

The reduced expression is \(\begin{bmatrix}16&32\\0&16\end{bmatrix}\). For a multiplication check, \(\mathbf{B}^2=\begin{bmatrix}4&4\\0&4\end{bmatrix}\), \(\mathbf{B}^3=\begin{bmatrix}8&12\\0&8\end{bmatrix}\), and so

$$ \mathbf{B}^4=\mathbf{B}^3\mathbf{B} =\begin{bmatrix}8&12\\0&8\end{bmatrix} \begin{bmatrix}2&1\\0&2\end{bmatrix} =\begin{bmatrix}16&32\\0&16\end{bmatrix}. $$

The two computations agree. In particular, the reduction does not require finding a basis of eigenvectors.

All Powers Reduce to a Bounded List

The recurrence has a useful general consequence: after reduction, no power higher than \(\mathbf{A}^{n-1}\) is needed. This is a statement about spanning a set of matrices; it does not claim that the listed matrices are linearly independent.

Corollary: For every \(\mathbf{A}\in\mathbb{R}^{n\times n}\) and every integer \(k\geq0\), the matrix \(\mathbf{A}^k\) is a linear combination of \(\mathbf{I}_n,\mathbf{A},\dots,\mathbf{A}^{n-1}\).

Proof. We use induction on \(k\). For \(0\leq k<n\), the claim holds because \(\mathbf{A}^k\) is itself one of the listed matrices. Now let \(k\geq n\), and assume that every power with exponent less than \(k\) is a linear combination of the list. By the power recurrence, \(\mathbf{A}^k\) is a linear combination of powers with exponents \(k-1,k-2,\dots,k-n\), all of which are nonnegative and less than \(k\). By the induction hypothesis, each of those powers is itself a linear combination of \(\mathbf{I}_n,\mathbf{A},\dots,\mathbf{A}^{n-1}\). Substituting those combinations proves the claim for \(k\), completing the induction. \(\square\)

Because polynomial evaluation is linear in the coefficients, the same conclusion applies to any polynomial in \(\mathbf{A}\): if \(f(\lambda)\) is a polynomial, then \(f(\mathbf{A})\) can be expressed using powers only from \(\mathbf{I}_n\) through \(\mathbf{A}^{n-1}\). To see why, write \(f\) as a finite sum of scalar multiples of powers. Each power in that sum can be replaced by the combination guaranteed by the corollary, and then the resulting terms can be collected.

Worked Example: Reducing a Fifth Power of a Three-by-Three Matrix

Let \(\mathbf{C}=\begin{bmatrix}1&1&0\\0&2&1\\0&0&3\end{bmatrix}\). Reduce \(\mathbf{C}^5\) to a combination of \(\mathbf{I}_3,\mathbf{C},\mathbf{C}^2\), and verify the result.

Since \(\mathbf{C}\) is upper triangular, its characteristic polynomial in our convention is the product of its diagonal entries after subtracting \(\lambda\):

$$ p_{\mathbf{C}}(\lambda) =(1-\lambda)(2-\lambda)(3-\lambda) =-\lambda^3+6\lambda^2-11\lambda+6. $$

Cayley–Hamilton gives \(-\mathbf{C}^3+6\mathbf{C}^2-11\mathbf{C}+6\mathbf{I}_3=\mathbf{O}\), so \(\mathbf{C}^3=6\mathbf{C}^2-11\mathbf{C}+6\mathbf{I}_3\). First compute

$$ \mathbf{C}^2= \begin{bmatrix}1&3&1\\0&4&5\\0&0&9\end{bmatrix}. $$

Using the recurrence for the next two powers gives

$$ \begin{aligned} \mathbf{C}^4 &=6\mathbf{C}^3-11\mathbf{C}^2+6\mathbf{C} =25\mathbf{C}^2-60\mathbf{C}+36\mathbf{I}_3,\\ \mathbf{C}^5 &=6\mathbf{C}^4-11\mathbf{C}^3+6\mathbf{C}^2 =90\mathbf{C}^2-239\mathbf{C}+150\mathbf{I}_3. \end{aligned} $$

Substituting \(\mathbf{C}^2\) and \(\mathbf{C}\) into the last expression yields

$$ 90\mathbf{C}^2-239\mathbf{C}+150\mathbf{I}_3 =\begin{bmatrix}1&31&90\\0&32&211\\0&0&243\end{bmatrix}. $$

For an independent check, the preceding reduction gives \(\mathbf{C}^4=\begin{bmatrix}1&15&25\\0&16&65\\0&0&81\end{bmatrix}\). Multiplying back by \(\mathbf{C}\) verifies the fifth power:

$$ \mathbf{C}^4\mathbf{C} = \begin{bmatrix}1&15&25\\0&16&65\\0&0&81\end{bmatrix} \begin{bmatrix}1&1&0\\0&2&1\\0&0&3\end{bmatrix} = \begin{bmatrix}1&31&90\\0&32&211\\0&0&243\end{bmatrix}. $$

The direct product matches the reduced expression entry by entry.

Coefficient Checks and Common Mistakes

A reliable reduction has two separate checks. First, verify the characteristic polynomial and its signs using the convention \(p_{\mathbf{A}}(\lambda)=\det(\mathbf{A}-\lambda\mathbf{I}_n)\). Second, verify that each use of the recurrence has the correct exponents and coefficients. The constant coefficient always multiplies the appropriate power, which is \(\mathbf{I}_n\) in the initial Cayley–Hamilton equation.

Common sign mistake: for the matrix \(\mathbf{A}\) in the first example, a wrong calculation might read \(\lambda^2-3\lambda+2=0\) as \(\mathbf{A}^2=3\mathbf{A}+2\mathbf{I}_2\). The constant term must instead move to the other side with a minus sign: \(\mathbf{A}^2-3\mathbf{A}+2\mathbf{I}_2=\mathbf{O}\), hence \(\mathbf{A}^2=3\mathbf{A}-2\mathbf{I}_2\). A quick check detects the error: the correct relation gives \(\begin{bmatrix}1&3\\0&4\end{bmatrix}\), which is the direct product \(\mathbf{A}\mathbf{A}\); the incorrect sign would give \(\begin{bmatrix}5&3\\0&8\end{bmatrix}\).

There is also a distinction between reducing to a short list and obtaining a unique expression. The corollary guarantees that some linear combination of \(\mathbf{I}_n,\mathbf{A},\dots,\mathbf{A}^{n-1}\) represents a given power. It does not guarantee that the coefficients are unique: the listed matrices may themselves satisfy additional linear relations. For this tutorial, the recurrence supplies a valid reduction; uniqueness is not needed.

Why the Reduction Is Useful

Once the recurrence is known, a high power can be computed by tracking a small number of coefficients rather than repeatedly multiplying full matrices. This is especially helpful when a later calculation needs \(\mathbf{A}^k\) for a large exponent, or when one wants a polynomial expression in \(\mathbf{A}\) in a lower-degree form. The method uses the characteristic polynomial and Cayley–Hamilton directly; it does not require that \(\mathbf{A}\) be diagonalizable.

For repeated calculations with the same matrix, record the recurrence beside the first reduced powers. For example, when the matrix size is three, every new power is obtained from the preceding three powers using the same coefficients. This makes the reduction systematic, while a final multiplication check helps catch arithmetic errors in the resulting matrix.

Check Your Understanding

Use Cayley–Hamilton for each reduction, and check at least one result by direct multiplication.

  1. If \(p_{\mathbf{A}}(\lambda)=\lambda^2-5\lambda+6\), write the relation for \(\mathbf{A}^2\) and the recurrence for \(\mathbf{A}^k\), where \(k\geq2\).
  2. For \(\mathbf{D}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\), find \(\mathbf{D}^4\) using its characteristic polynomial.
  3. For \(p_{\mathbf{B}}(\lambda)=-\lambda^3+4\lambda^2-5\lambda+2\), express \(\mathbf{B}^3\) in terms of \(\mathbf{I}_3,\mathbf{B},\mathbf{B}^2\).
  4. Explain why reducing every power in a polynomial expression shows that the expression is a combination of \(\mathbf{I}_n,\mathbf{A},\dots,\mathbf{A}^{n-1}\).
  5. In a reduction, what matrix multiplies the constant term in the Cayley–Hamilton equation?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon