Tutorials › Linear Algebra › Powers and Polynomials Under Similarity

Similarity and Change of Basis for Operators · Tutorial 475 of 1000

Powers and Polynomials Under Similarity

Use the power and polynomial identities for similar matrices, and apply them to compute matrix powers and polynomial expressions efficiently.

Intermediate 10 min read

What You'll Learn

  • Prove the similarity identity for every nonnegative integer power, including the zeroth power.
  • Derive the corresponding identity for any real polynomial evaluated at a matrix.
  • Compute large powers by transferring the calculation to a simpler similar matrix.
  • Evaluate a polynomial in one matrix and transfer the result across a similarity.
  • Identify and correct a common error in the order of matrix multiplication.

Similarity and Repeated Multiplication

Similar matrices represent the same linear operator in different bases. A change of basis can make a matrix easier to work with, but it is useful only if calculations performed in the simpler representation can be translated back correctly. Powers and polynomials are two important cases where this translation has a precise rule.

Throughout, let \(\mathbf{A},\mathbf{B},\mathbf{P}\in\mathbb{R}^{n\times n}\), with \(\mathbf{P}\) invertible. The matrices \(\mathbf{A}\) and \(\mathbf{B}\) are similar when \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\). Matrix multiplication is associative, but in general it is not commutative: the order of factors matters. In particular, the factors \(\mathbf{P}\) and \(\mathbf{P}^{-1}\) can be cancelled when they are adjacent, but they cannot be moved past \(\mathbf{A}\) at will.

Definition: For a square matrix \(\mathbf{A}\), define \(\mathbf{A}^0=\mathbf{I}_n\), and for each integer \(k\ge 1\), define \(\mathbf{A}^k\) to be the product of \(k\) copies of \(\mathbf{A}\). If \(q(t)=c_0+c_1t+\cdots+c_mt^m\) is a polynomial with real coefficients, define its value at \(\mathbf{A}\) by \(q(\mathbf{A})=c_0\mathbf{I}_n+c_1\mathbf{A}+\cdots+c_m\mathbf{A}^m\).

This definition includes constant polynomials: if \(q(t)=c_0\), then \(q(\mathbf{A})=c_0\mathbf{I}_n\). The zero polynomial gives the zero matrix. Polynomial evaluation uses sums and powers of one matrix; it does not mean that arbitrary matrix factors can be rearranged.

The Identity for Powers

Theorem: If \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), where \(\mathbf{P}\) is invertible, then for every integer \(k\ge 0\), \(\mathbf{B}^k=\mathbf{P}^{-1}\mathbf{A}^k\mathbf{P}\).

Proof. We use induction on \(k\). For \(k=0\), the definition of the zeroth power and the inverse identity give \(\mathbf{B}^0=\mathbf{I}_n=\mathbf{P}^{-1}\mathbf{I}_n\mathbf{P}=\mathbf{P}^{-1}\mathbf{A}^0\mathbf{P}\). Now suppose the formula holds for some \(k\ge0\). Using the definition \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), associativity, and \(\mathbf{P}\mathbf{P}^{-1}=\mathbf{I}_n\), we obtain \(\mathbf{B}^{k+1}=\mathbf{B}^k\mathbf{B}=(\mathbf{P}^{-1}\mathbf{A}^k\mathbf{P})(\mathbf{P}^{-1}\mathbf{A}\mathbf{P})=\mathbf{P}^{-1}\mathbf{A}^k(\mathbf{P}\mathbf{P}^{-1})\mathbf{A}\mathbf{P}=\mathbf{P}^{-1}\mathbf{A}^{k+1}\mathbf{P}\). Thus the formula holds at \(k=0\), and whenever it holds at \(k\) it holds at \(k+1\); it follows for every integer \(k\ge0\). \(\square\)

The proof works because each adjacent pair \(\mathbf{P}\mathbf{P}^{-1}\) cancels as the product is extended by one more factor. The matrices are square and \(\mathbf{P}\) is invertible, which ensures that both \(\mathbf{P}^{-1}\) and the identities involving \(\mathbf{I}_n\) are defined. No diagonalization assumption is involved.

Worked Example: Comparing Several Powers

Let \(\mathbf{A}=\begin{bmatrix}2&1\\0&3\end{bmatrix}\) and \(\mathbf{P}=\begin{bmatrix}1&0\\0&2\end{bmatrix}\). Find \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), then compute \(\mathbf{B}^2\) and verify the power identity for \(k=2\).

First, \(\mathbf{P}^{-1}=\begin{bmatrix}1&0\\0&\tfrac12\end{bmatrix}\). Multiplying in the stated order gives

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}2&1\\0&3\end{bmatrix} \begin{bmatrix}1&0\\0&2\end{bmatrix} = \begin{bmatrix}2&2\\0&6\end{bmatrix}, \qquad \mathbf{B} = \begin{bmatrix}1&0\\0&\tfrac12\end{bmatrix} \begin{bmatrix}2&2\\0&6\end{bmatrix} = \begin{bmatrix}2&2\\0&3\end{bmatrix}. $$

Compute each square directly:

$$ \mathbf{A}^2 = \begin{bmatrix}2&1\\0&3\end{bmatrix} \begin{bmatrix}2&1\\0&3\end{bmatrix} = \begin{bmatrix}4&5\\0&9\end{bmatrix}, \qquad \mathbf{B}^2 = \begin{bmatrix}2&2\\0&3\end{bmatrix} \begin{bmatrix}2&2\\0&3\end{bmatrix} = \begin{bmatrix}4&10\\0&9\end{bmatrix}. $$

Now transfer \(\mathbf{A}^2\) using \(\mathbf{P}^{-1}\mathbf{A}^2\mathbf{P}\):

$$ \mathbf{P}^{-1}\mathbf{A}^2\mathbf{P} = \begin{bmatrix}1&0\\0&\tfrac12\end{bmatrix} \begin{bmatrix}4&5\\0&9\end{bmatrix} \begin{bmatrix}1&0\\0&2\end{bmatrix} = \begin{bmatrix}1&0\\0&\tfrac12\end{bmatrix} \begin{bmatrix}4&10\\0&18\end{bmatrix} = \begin{bmatrix}4&10\\0&9\end{bmatrix} = \mathbf{B}^2. $$

Check: Direct multiplication gave \(\mathbf{B}^2=\begin{bmatrix}4&10\\0&9\end{bmatrix}\), and transferring \(\mathbf{A}^2\) gave the same matrix. The theorem predicts this agreement.

The Identity for Polynomials

The power formula extends to any polynomial because evaluating a polynomial means taking a finite linear combination of powers. The coefficients are scalars, so they multiply the matrices without changing their order.

Theorem: Suppose \(\mathbf{A},\mathbf{B}\in\mathbb{R}^{n\times n}\), \(\mathbf{P}\) is invertible, and \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\). For every real polynomial \(q(t)=\sum_{j=0}^{m}c_jt^j\), \(q(\mathbf{B})=\mathbf{P}^{-1}q(\mathbf{A})\mathbf{P}\).

Proof. By the definition of polynomial evaluation and the power theorem, including its case \(j=0\), \(q(\mathbf{B})=\sum_{j=0}^{m}c_j\mathbf{B}^j=\sum_{j=0}^{m}c_j(\mathbf{P}^{-1}\mathbf{A}^j\mathbf{P})\). For each \(j\), the scalar \(c_j\) can be placed between the matrices as \(c_j(\mathbf{P}^{-1}\mathbf{A}^j\mathbf{P})=\mathbf{P}^{-1}(c_j\mathbf{A}^j)\mathbf{P}\). Distributing the finite sums and factoring the common matrices on the left and right therefore gives \(q(\mathbf{B})=\mathbf{P}^{-1}(\sum_{j=0}^{m}c_j\mathbf{A}^j)\mathbf{P}=\mathbf{P}^{-1}q(\mathbf{A})\mathbf{P}\). If \(q\) is the zero polynomial or has degree zero, the same calculation applies; in particular, \(\mathbf{P}^{-1}(c_0\mathbf{I}_n)\mathbf{P}=c_0\mathbf{I}_n\). \(\square\)

This theorem gives a two-way computational option. One may first evaluate \(q\) at \(\mathbf{A}\) and then transfer the result, or first form the similar matrix \(\mathbf{B}\), evaluate \(q\) there, and obtain the same answer. The choice is useful when one matrix has a simpler structure than the other.

Worked Example: Evaluating a Polynomial in Similar Matrices

Use the matrices from the previous example and \(q(t)=t^2-2t+4\). Compute \(q(\mathbf{A})\) and \(q(\mathbf{B})\), then verify the polynomial identity.

For \(\mathbf{A}\), the constant term contributes \(4\mathbf{I}_2\). Thus

$$ q(\mathbf{A}) = \begin{bmatrix}4&5\\0&9\end{bmatrix} - 2\begin{bmatrix}2&1\\0&3\end{bmatrix} + 4\begin{bmatrix}1&0\\0&1\end{bmatrix} = \begin{bmatrix}4&5\\0&9\end{bmatrix} + \begin{bmatrix}-4&-2\\0&-6\end{bmatrix} + \begin{bmatrix}4&0\\0&4\end{bmatrix} = \begin{bmatrix}4&3\\0&7\end{bmatrix}. $$

For \(\mathbf{B}\), using the square computed above gives

$$ q(\mathbf{B}) = \begin{bmatrix}4&10\\0&9\end{bmatrix} - 2\begin{bmatrix}2&2\\0&3\end{bmatrix} + 4\begin{bmatrix}1&0\\0&1\end{bmatrix} = \begin{bmatrix}4&10\\0&9\end{bmatrix} + \begin{bmatrix}-4&-4\\0&-6\end{bmatrix} + \begin{bmatrix}4&0\\0&4\end{bmatrix} = \begin{bmatrix}4&6\\0&7\end{bmatrix}. $$

Transfer \(q(\mathbf{A})\) to check the result:

$$ \mathbf{P}^{-1}q(\mathbf{A})\mathbf{P} = \begin{bmatrix}1&0\\0&\tfrac12\end{bmatrix} \begin{bmatrix}4&3\\0&7\end{bmatrix} \begin{bmatrix}1&0\\0&2\end{bmatrix} = \begin{bmatrix}1&0\\0&\tfrac12\end{bmatrix} \begin{bmatrix}4&6\\0&14\end{bmatrix} = \begin{bmatrix}4&6\\0&7\end{bmatrix}. $$

Check: The transferred value matches the direct calculation of \(q(\mathbf{B})\). The constant term is \(4\mathbf{I}_2\), not a matrix with every entry equal to \(4\).

Simplifying a Large Power

A particularly effective application is to choose a similar matrix whose powers are easy to compute. The next example uses a diagonal matrix. The relevant calculation is just repeated multiplication of diagonal entries; no claim about eigenvalues is needed.

Worked Example: Computing a Fifth Power Through a Diagonal Matrix

Let \(\mathbf{P}=\begin{bmatrix}1&1\\1&-1\end{bmatrix}\) and \(\mathbf{D}=\begin{bmatrix}1&0\\0&3\end{bmatrix}\). Use \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\) to compute \(\mathbf{A}^5\).

Since \(\mathbf{P}^2=2\mathbf{I}_2\), its inverse is \(\mathbf{P}^{-1}=\tfrac12\mathbf{P}\). First form \(\mathbf{A}\):

$$ \mathbf{P}\mathbf{D} = \begin{bmatrix}1&1\\1&-1\end{bmatrix} \begin{bmatrix}1&0\\0&3\end{bmatrix} = \begin{bmatrix}1&3\\1&-3\end{bmatrix}, \qquad \mathbf{A} = \frac12 \begin{bmatrix}1&3\\1&-3\end{bmatrix} \begin{bmatrix}1&1\\1&-1\end{bmatrix} = \begin{bmatrix}2&-1\\-1&2\end{bmatrix}. $$

The power identity applies with the roles arranged as \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\), so \(\mathbf{A}^5=\mathbf{P}\mathbf{D}^5\mathbf{P}^{-1}\). The diagonal power is

$$ \mathbf{D}^5 = \begin{bmatrix}1^5&0\\0&3^5\end{bmatrix} = \begin{bmatrix}1&0\\0&243\end{bmatrix}. $$

Now multiply:

$$ \mathbf{P}\mathbf{D}^5\mathbf{P}^{-1} = \frac12 \begin{bmatrix}1&243\\1&-243\end{bmatrix} \begin{bmatrix}1&1\\1&-1\end{bmatrix} = \frac12 \begin{bmatrix}244&-242\\-242&244\end{bmatrix} = \begin{bmatrix}122&-121\\-121&122\end{bmatrix}. $$

Check: Multiplying \(\mathbf{A}\) by the proposed result gives \(\begin{bmatrix}2&-1\\-1&2\end{bmatrix}\begin{bmatrix}122&-121\\-121&122\end{bmatrix}=\begin{bmatrix}365&-364\\-364&365\end{bmatrix}\). This also equals \(\mathbf{P}\mathbf{D}^6\mathbf{P}^{-1}\), since \(\mathbf{D}^6=\begin{bmatrix}1&0\\0&729\end{bmatrix}\), giving \(\tfrac12\begin{bmatrix}730&-728\\-728&730\end{bmatrix}=\begin{bmatrix}365&-364\\-364&365\end{bmatrix}\). Thus the proposed fifth power passes the check \(\mathbf{A}\mathbf{A}^5=\mathbf{A}^6\).

Common Pitfall: Reordering the Factors

The identity does not permit moving \(\mathbf{P}\) or \(\mathbf{P}^{-1}\) through \(\mathbf{A}\). A common incorrect step is to claim \((\mathbf{P}^{-1}\mathbf{A}\mathbf{P})^2=\mathbf{P}^{-2}\mathbf{A}^2\mathbf{P}^2\). That expression is not the result of the power theorem: it wrongly combines factors on opposite sides of \(\mathbf{A}\). In the first worked example, that incorrect expression would use \(\mathbf{P}^{-2}=\begin{bmatrix}1&0\\0&\tfrac14\end{bmatrix}\) and \(\mathbf{P}^2=\begin{bmatrix}1&0\\0&4\end{bmatrix}\). It would therefore give

$$ \mathbf{P}^{-2}\mathbf{A}^2\mathbf{P}^2 = \begin{bmatrix}1&0\\0&\tfrac14\end{bmatrix} \begin{bmatrix}4&5\\0&9\end{bmatrix} \begin{bmatrix}1&0\\0&4\end{bmatrix} = \begin{bmatrix}4&20\\0&9\end{bmatrix}, $$

which is not \(\mathbf{B}^2=\begin{bmatrix}4&10\\0&9\end{bmatrix}\). The correct expansion keeps the factors in their original order: \((\mathbf{P}^{-1}\mathbf{A}\mathbf{P})(\mathbf{P}^{-1}\mathbf{A}\mathbf{P})=\mathbf{P}^{-1}\mathbf{A}(\mathbf{P}\mathbf{P}^{-1})\mathbf{A}\mathbf{P}=\mathbf{P}^{-1}\mathbf{A}^2\mathbf{P}\). Only the adjacent inverse pair cancels.

When These Identities Are Useful

Similarity lets us move a calculation between two representations without changing its mathematical content. If \(\mathbf{B}\) is simpler to raise to a power or substitute into a polynomial, compute there and use the identity to relate the result to the corresponding expression in \(\mathbf{A}\). For example, a diagonal matrix makes powers particularly direct, while a matrix with many zero entries can make a polynomial calculation shorter.

The formulas apply to every polynomial and every nonnegative integer power, whether or not the matrices have any additional structure. They do not say that \(\mathbf{A}\) and \(\mathbf{B}\) are equal, nor do they allow arbitrary products involving other matrices to be rearranged. The reliable method is to keep the conjugating matrices at the two ends, preserve the order of all factors in the middle, and cancel only adjacent \(\mathbf{P}\mathbf{P}^{-1}\) pairs.

Check Your Understanding

For each question, use the definitions and keep track of factor order.

  1. State the power identity for \(k=0\) and explain why it holds.
  2. If \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), write \(q(\mathbf{B})\) in terms of \(q(\mathbf{A})\) for \(q(t)=3-2t+t^3\).
  3. For \(\mathbf{P}=\begin{bmatrix}1&0\\0&2\end{bmatrix}\) and \(\mathbf{A}=\begin{bmatrix}2&1\\0&3\end{bmatrix}\), calculate \(\mathbf{B}\) and check \(\mathbf{B}^2=\mathbf{P}^{-1}\mathbf{A}^2\mathbf{P}\).
  4. In the polynomial definition, what matrix represents the constant term \(c_0\)?
  5. Explain why \((\mathbf{P}^{-1}\mathbf{A}\mathbf{P})^2\) simplifies to \(\mathbf{P}^{-1}\mathbf{A}^2\mathbf{P}\), but not in general to \(\mathbf{P}^{-2}\mathbf{A}^2\mathbf{P}^2\).

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