Tutorials › Linear Algebra › Polynomial Evaluation at a Matrix

Invariant Subspaces and Cayley-Hamilton · Tutorial 574 of 1000

Polynomial Evaluation at a Matrix

You will define polynomial evaluation at an operator, prove its basic algebra rules, and test whether particular polynomials evaluate to the zero matrix.

Advanced 9 min read

What You'll Learn

  • Define polynomial evaluation at a linear operator using powers and the identity map
  • Prove that evaluation preserves polynomial sums and products
  • Compute polynomial values at matrices using exact arithmetic
  • Determine all coefficients that make a polynomial annihilate a given matrix
  • Use eigenvectors to identify a necessary condition for a polynomial to annihilate a matrix

Substituting an Operator for a Variable

A polynomial is usually evaluated at a scalar: for example, if \(p(t)=t^2-2t+1\), then \(p(3)=3^2-2(3)+1\). The same expression can be evaluated at a linear operator or a square matrix. The key adjustment is that the constant term acts by a multiple of the identity, not by a multiple of a scalar number. This definition lets us use ordinary polynomial algebra while keeping track of what its terms mean as operators.

Let \(V\) be a vector space over \(\mathbb{F}\), where \(\mathbb{F}\) is \(\mathbb{R}\) or \(\mathbb{C}\), and let \(T:V\to V\) be linear. A polynomial over \(\mathbb{F}\) has the form \(p(t)=a_0+a_1t+\cdots+a_dt^d\), with coefficients \(a_i\in\mathbb{F}\). The symbol \(t\) is a scalar variable in the polynomial; it is replaced by \(T\) only when we evaluate the polynomial. Write \(T^0=\operatorname{id}_V\), the identity map on \(V\), and \(T^k\) for \(k\) successive compositions of \(T\) when \(k\geq 1\).

Definition: The evaluation of \(p(t)=\sum_{i=0}^d a_i t^i\) at \(T\) is the linear operator \(p(T)=\sum_{i=0}^d a_iT^i=a_0\operatorname{id}_V+a_1T+\cdots+a_dT^d\). The zero polynomial evaluates to the zero operator. A polynomial \(p\) is said to annihilate \(T\) if \(p(T)\) is the zero operator.

When \(T\) is represented by a square matrix \(\mathbf{A}\), the same definition gives \(p(\mathbf{A})=a_0\mathbf{I}+a_1\mathbf{A}+\cdots+a_d\mathbf{A}^d\). Each scalar coefficient multiplies the corresponding matrix, so the constant term is \(a_0\mathbf{I}\). For the zero polynomial, it is convenient to regard all coefficients as zero; the definition then gives the zero operator or zero matrix directly.

Why Evaluation Preserves Sums and Products

Polynomial evaluation respects the two basic operations of polynomial algebra. In the product rule, \(p(T)q(T)\) means composition of the operators \(p(T)\) and \(q(T)\). These operators are built from powers of the same \(T\), which is what makes the product rule work.

Theorem: Let \(T:V\to V\) be linear on a vector space over \(\mathbb{F}\), and let \(p,q\in\mathbb{F}[t]\). Then \((p+q)(T)=p(T)+q(T)\) and \((pq)(T)=p(T)q(T)\). Also, for any \(c\in\mathbb{F}\), \((cp)(T)=c\,p(T)\).

Proof. Write \(p(t)=\sum_{i=0}^r a_i t^i\) and \(q(t)=\sum_{j=0}^s b_jt^j\), allowing zero coefficients if their degrees differ. The coefficient of \(t^i\) in \(p+q\) is \(a_i+b_i\), where missing coefficients are taken to be zero. Substitution therefore gives \((p+q)(T)=\sum_i(a_i+b_i)T^i=\sum_i a_iT^i+\sum_i b_iT^i=p(T)+q(T)\). The scalar rule follows in the same way by distributing \(c\) through the finite sum for \(p(T)\).

For the product, the coefficient of \(t^k\) in \(pq\) is \(\sum_{i+j=k}a_i b_j\). Composition of powers satisfies \(T^iT^j=T^{i+j}\): composing \(j\) copies of \(T\) and then \(i\) copies gives \(i+j\) copies, including \(T^0=\operatorname{id}_V\). Distributing the finite sums now gives \((pq)(T)=\sum_k\bigl(\sum_{i+j=k}a_i b_j\bigr)T^k=\sum_i\sum_j a_i b_jT^{i+j}=(\sum_i a_iT^i)(\sum_j b_jT^j)=p(T)q(T)\). In the last equality, each scalar coefficient can be moved through an operator because scalar multiplication commutes with linear operators. This proves all three identities. \(\square\)

The product identity does not require \(T\) to be invertible. It also does not require \(V\) to be finite-dimensional. The identity map is needed even when \(T\) is not invertible, because \(T^0\) is defined to be \(\operatorname{id}_V\), not an inverse or a zero map.

Computing Polynomial Values at Matrices

Worked Example: A Polynomial That Annihilates a Matrix

Evaluate \(p(\mathbf{A})\) for \(p(t)=t^2-2t+1\) and \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\), and determine whether \(p\) annihilates \(\mathbf{A}\).

First calculate the square by matrix multiplication:

$$ \mathbf{A}^2= \begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} = \begin{bmatrix}1&2\\0&1\end{bmatrix}. $$

The constant term contributes \(\mathbf{I}_2\), so

$$ p(\mathbf{A})=\mathbf{A}^2-2\mathbf{A}+\mathbf{I}_2 =\begin{bmatrix}1&2\\0&1\end{bmatrix} +\begin{bmatrix}-2&-2\\0&-2\end{bmatrix} +\begin{bmatrix}1&0\\0&1\end{bmatrix} =\begin{bmatrix}0&0\\0&0\end{bmatrix}. $$

Thus \(p\) annihilates \(\mathbf{A}\). The product rule also gives \(p(\mathbf{A})=(\mathbf{A}-\mathbf{I}_2)^2\). Indeed, \(\mathbf{A}-\mathbf{I}_2=\begin{bmatrix}0&1\\0&0\end{bmatrix}\), and its square is the zero matrix, confirming the result by multiplication.

This example shows why a matrix polynomial is not evaluated by applying the scalar polynomial separately to each entry. Matrix powers involve matrix multiplication, so their entries depend on products and sums across rows and columns.

Worked Example: Annihilating a Rotation Matrix

Let \(\mathbf{B}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\) and \(q(t)=t^2+1\). Compute \(q(\mathbf{B})\).

Multiplying \(\mathbf{B}\) by itself gives

$$ \mathbf{B}^2= \begin{bmatrix}0&-1\\1&0\end{bmatrix} \begin{bmatrix}0&-1\\1&0\end{bmatrix} = \begin{bmatrix}-1&0\\0&-1\end{bmatrix} =-\mathbf{I}_2. $$

Substitution and the constant-term rule therefore yield

$$ q(\mathbf{B})=\mathbf{B}^2+\mathbf{I}_2 =\begin{bmatrix}-1&0\\0&-1\end{bmatrix} +\begin{bmatrix}1&0\\0&1\end{bmatrix} =\begin{bmatrix}0&0\\0&0\end{bmatrix}. $$

Hence \(t^2+1\) annihilates \(\mathbf{B}\). The calculation checks the claim directly: the square is \(-\mathbf{I}_2\), and adding the identity gives the zero matrix.

Finding All Annihilating Polynomials in a Simple Case

To decide whether a polynomial annihilates a matrix, evaluate it and test whether every entry of the result is zero. If the polynomial contains unknown coefficients, this procedure produces equations for those coefficients.

Worked Example: A Family of Polynomials

For which real numbers \(a,b,c\) does \(p(t)=at^2+bt+c\) annihilate \(\mathbf{N}=\begin{bmatrix}0&1\\0&0\end{bmatrix}\)?

First square \(\mathbf{N}\):

$$ \mathbf{N}^2= \begin{bmatrix}0&1\\0&0\end{bmatrix} \begin{bmatrix}0&1\\0&0\end{bmatrix} = \begin{bmatrix}0&0\\0&0\end{bmatrix}. $$

Then substitute each term of \(p\), using \(c\mathbf{I}_2\) for the constant term:

$$ p(\mathbf{N})=a\mathbf{N}^2+b\mathbf{N}+c\mathbf{I}_2 =\begin{bmatrix}0&0\\0&0\end{bmatrix} +\begin{bmatrix}0&b\\0&0\end{bmatrix} +\begin{bmatrix}c&0\\0&c\end{bmatrix} =\begin{bmatrix}c&b\\0&c\end{bmatrix}. $$

This is the zero matrix exactly when its entries \(c\) and \(b\) are both zero. There is no condition on \(a\), since the term \(a\mathbf{N}^2\) is zero for every \(a\). Therefore the complete answer is \(b=0\) and \(c=0\), with \(a\) arbitrary. Substituting these conditions gives \(p(\mathbf{N})=a\mathbf{N}^2=\mathbf{O}\), which checks the answer.

What Eigenvectors Tell Us

There is a useful test involving eigenvalues. Recall that an eigenvector of a linear operator \(T\) is a nonzero vector \(\mathbf{v}\) such that \(T\mathbf{v}=\lambda\mathbf{v}\) for some scalar \(\lambda\), called its eigenvalue. Polynomial evaluation acts on such a vector by the corresponding scalar polynomial value.

Theorem: If \(T:V\to V\) is linear over \(\mathbb{F}\), \(T\mathbf{v}=\lambda\mathbf{v}\), and \(p\in\mathbb{F}[t]\), then \(p(T)\mathbf{v}=p(\lambda)\mathbf{v}\).

Proof. First, \(T^0\mathbf{v}=\operatorname{id}_V(\mathbf{v})=\mathbf{v}=\lambda^0\mathbf{v}\). If \(T^k\mathbf{v}=\lambda^k\mathbf{v}\), then \(T^{k+1}\mathbf{v}=T(T^k\mathbf{v})=T(\lambda^k\mathbf{v})=\lambda^kT\mathbf{v}=\lambda^{k+1}\mathbf{v}\), by linearity and the eigenvector equation. Induction gives \(T^k\mathbf{v}=\lambda^k\mathbf{v}\) for every nonnegative integer \(k\). Therefore, for \(p(t)=\sum_{k=0}^d a_kt^k\), \(p(T)\mathbf{v}=\sum_{k=0}^d a_kT^k\mathbf{v}=\sum_{k=0}^d a_k\lambda^k\mathbf{v}=p(\lambda)\mathbf{v}\), as required. \(\square\)

Consequently, if \(p(T)\) is the zero operator and \(\lambda\) is an eigenvalue of \(T\), then \(p(\lambda)=0\). To justify this implication, take an eigenvector \(\mathbf{v}\ne\mathbf{0}\). The theorem gives \(\mathbf{0}=p(T)\mathbf{v}=p(\lambda)\mathbf{v}\), which forces the scalar \(p(\lambda)\) to be zero. This condition is necessary, but it does not by itself prove that \(p(T)\) is zero; the matrix calculations above show why direct evaluation can still be required.

Common Mistake: Treating a Matrix Like a List of Entries

A tempting but incorrect calculation is to evaluate a polynomial separately at each entry of a matrix. For example, take \(\mathbf{C}=\begin{bmatrix}1&1\\1&0\end{bmatrix}\) and \(r(t)=t^2\). Squaring each entry would incorrectly give \(\begin{bmatrix}1&1\\1&0\end{bmatrix}\). The definition instead requires matrix multiplication:

$$ r(\mathbf{C})=\mathbf{C}^2 =\begin{bmatrix}1&1\\1&0\end{bmatrix} \begin{bmatrix}1&1\\1&0\end{bmatrix} =\begin{bmatrix}2&1\\1&1\end{bmatrix}. $$

The two answers differ, so entrywise substitution is not polynomial evaluation at a matrix. A related error is to write \(a_0\) alone for the constant term. In a matrix polynomial the correct term is \(a_0\mathbf{I}\), because every term in the sum must be a matrix of the same size.

Polynomial evaluation is useful because it turns algebraic expressions into concrete operators while preserving addition, scalar multiplication, and multiplication. The product rule can simplify a calculation when a polynomial factors, and direct entry calculations settle whether the result is actually zero. The eigenvector test supplies a quick necessary check, but the defining calculation remains the decisive test for an annihilating polynomial.

Check Your Understanding

For each question, use the definition of polynomial evaluation and show enough matrix or operator arithmetic to justify the conclusion.

  1. For \(\mathbf{A}=\begin{bmatrix}2&0\\0&3\end{bmatrix}\), compute \((t^2-5t+6)(\mathbf{A})\).
  2. For \(\mathbf{B}=\begin{bmatrix}0&1\\0&0\end{bmatrix}\), determine which real \(b,c\) make \((t^2+bt+c)(\mathbf{B})=\mathbf{O}\).
  3. Explain why the constant polynomial \(p(t)=4\) evaluates at a linear operator \(T:V\to V\) as \(4\operatorname{id}_V\).
  4. If \(\mathbf{v}\ne\mathbf{0}\) and \(\mathbf{A}\mathbf{v}=2\mathbf{v}\), what condition must a polynomial \(p\) satisfy if \(p(\mathbf{A})=\mathbf{O}\)?
  5. For \(\mathbf{C}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\), verify by multiplication whether \(t^2+1\) annihilates \(\mathbf{C}\).

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