Tutorials › Linear Algebra › Computing Iterates by Diagonalizing the State Matrix

Applications of Diagonalization · Tutorial 582 of 1000

Computing Iterates by Diagonalizing the State Matrix

Use a real diagonalization to calculate a discrete linear system’s state after \(k\) steps, and verify the result against the original recurrence.

Intermediate 9 min read

What You'll Learn

  • Express a discrete-time system as repeated multiplication by its state matrix.
  • Identify the conditions needed to use a real diagonalization.
  • Compute powers of a diagonalizable matrix, including the case \(k=0\).
  • Find initial-state coordinates in an eigenvector basis.
  • Check a closed-form state formula by substitution into the recurrence.
  • Avoid omitting the inverse matrix when computing powers by diagonalization.

From Repeated Updates to a Power

A discrete-time linear system updates its state by applying the same matrix at each step. If the state at step \(k\) is \(\mathbf{x}_k\in\mathbb{R}^n\) and the state matrix is \(\mathbf{A}\in\mathbb{R}^{n\times n}\), the update rule is \(\mathbf{x}_{k+1}=\mathbf{A}\mathbf{x}_k\). Starting from \(\mathbf{x}_0\), the first few states are \(\mathbf{x}_1=\mathbf{A}\mathbf{x}_0\), \(\mathbf{x}_2=\mathbf{A}^2\mathbf{x}_0\), and \(\mathbf{x}_3=\mathbf{A}^3\mathbf{x}_0\). Thus the state after \(k\) steps is determined by the matrix power \(\mathbf{A}^k\).

Calculating \(\mathbf{A}^k\) by multiplying \(\mathbf{A}\) by itself repeatedly can become cumbersome when \(k\) is large. If \(\mathbf{A}\) is diagonalizable over \(\mathbb{R}\), its powers can instead be computed using powers of a diagonal matrix. A diagonal matrix is especially convenient to raise to a power: each diagonal entry is raised to that power separately.

Definition: A real \(n\times n\) matrix \(\mathbf{A}\) is diagonalizable over \(\mathbb{R}\) if there are an invertible matrix \(\mathbf{P}\in\mathbb{R}^{n\times n}\) and a diagonal matrix \(\mathbf{D}\in\mathbb{R}^{n\times n}\) such that \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\). In an eigenvector diagonalization, the columns of \(\mathbf{P}\) are a basis of real eigenvectors of \(\mathbf{A}\), and the corresponding eigenvalues appear in the same order on the diagonal of \(\mathbf{D}\).

The diagonal entries of \(\mathbf{D}\) may be repeated, and they may be zero. To use this method, the essential requirement is the displayed factorization with \(\mathbf{P}\) invertible; having real eigenvalues alone is not the definition of diagonalizability. Once the factorization is known, the power formula applies for every nonnegative integer \(k\), including \(k=0\).

Theorem (Power formula for a diagonalization): If \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\), where \(\mathbf{P}\) is invertible and \(\mathbf{D}\) is diagonal, then for every integer \(k\geq 0\), $$ \mathbf{A}^k=\mathbf{P}\mathbf{D}^k\mathbf{P}^{-1}. $$ If \(\mathbf{D}=\operatorname{diag}(\lambda_1,\dots,\lambda_n)\), then \(\mathbf{D}^k=\operatorname{diag}(\lambda_1^k,\dots,\lambda_n^k)\) for \(k\geq 1\), while \(\mathbf{D}^0=\mathbf{I}_n\).

Proof. For \(k=0\), the definition of the zeroth power gives \(\mathbf{A}^0=\mathbf{I}_n\), and \(\mathbf{P}\mathbf{D}^0\mathbf{P}^{-1}=\mathbf{P}\mathbf{I}_n\mathbf{P}^{-1}=\mathbf{P}\mathbf{P}^{-1}=\mathbf{I}_n\). Now suppose the formula holds for some \(k\geq0\). Using \(\mathbf{P}^{-1}\mathbf{P}=\mathbf{I}_n\), we obtain $$ \mathbf{A}^{k+1}=\mathbf{A}^k\mathbf{A} =(\mathbf{P}\mathbf{D}^k\mathbf{P}^{-1})(\mathbf{P}\mathbf{D}\mathbf{P}^{-1}) =\mathbf{P}\mathbf{D}^k\mathbf{D}\mathbf{P}^{-1} =\mathbf{P}\mathbf{D}^{k+1}\mathbf{P}^{-1}. $$ Induction proves the formula for every \(k\geq0\). The rule for \(\mathbf{D}^k\) follows from multiplying diagonal matrices: the diagonal entries multiply with one another, and every off-diagonal entry remains zero. \(\square\)

A Practical Calculation

To calculate a state from a diagonalization, first express the initial state in the eigenvector basis. If \(\mathbf{P}\) has the eigenvectors as its columns, this means computing \(\mathbf{c}=\mathbf{P}^{-1}\mathbf{x}_0\). Then \(\mathbf{D}^k\) scales each coordinate by the corresponding eigenvalue raised to \(k\), and multiplying by \(\mathbf{P}\) returns the result to the original coordinates. In symbols, \(\mathbf{x}_k=\mathbf{P}\mathbf{D}^k\mathbf{c}\). This is the power formula applied to the initial state, with \(\mathbf{P}^{-1}\mathbf{x}_0=\mathbf{c}\).

1
Find an eigenvector basis.
Place the basis eigenvectors, in a fixed order, as the columns of \(\mathbf{P}\), and place the matching eigenvalues in the same order along the diagonal of \(\mathbf{D}\).
2
Check the diagonalization.
Confirm that \(\mathbf{P}\) is invertible and that \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\), or equivalently that \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{D}\).
3
Convert the initial state.
Compute \(\mathbf{c}=\mathbf{P}^{-1}\mathbf{x}_0\). These entries give the initial state’s coordinates in the eigenvector basis.
4
Apply the powers and convert back.
Compute \(\mathbf{x}_k=\mathbf{P}\mathbf{D}^k\mathbf{c}\), then check the result at \(k=0\) and against the update rule.

Worked Examples

Worked Example: A Symmetric Two-State System

Let $$ \mathbf{A}=\begin{bmatrix}2&1\\1&2\end{bmatrix}, \qquad \mathbf{x}_0=\begin{bmatrix}2\\0\end{bmatrix}. $$ Find \(\mathbf{x}_k\) for any integer \(k\geq0\).

The vector \(\begin{bmatrix}1\\1\end{bmatrix}\) is an eigenvector with eigenvalue \(3\), because $$ \mathbf{A}\begin{bmatrix}1\\1\end{bmatrix} =\begin{bmatrix}3\\3\end{bmatrix} =3\begin{bmatrix}1\\1\end{bmatrix}. $$ The vector \(\begin{bmatrix}1\\-1\end{bmatrix}\) is an eigenvector with eigenvalue \(1\), because $$ \mathbf{A}\begin{bmatrix}1\\-1\end{bmatrix} =\begin{bmatrix}1\\-1\end{bmatrix}. $$ Use these vectors as the columns of \(\mathbf{P}\), in that order, and match their eigenvalues in \(\mathbf{D}\):

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

Indeed, direct multiplication gives \(\mathbf{P}\mathbf{P}^{-1}=\mathbf{I}_2\), and $$ \mathbf{P}\mathbf{D}\mathbf{P}^{-1} =\frac12\begin{bmatrix}3&1\\3&-1\end{bmatrix} \begin{bmatrix}1&1\\1&-1\end{bmatrix} =\begin{bmatrix}2&1\\1&2\end{bmatrix} =\mathbf{A}. $$ The initial coordinates are $$ \mathbf{c}=\mathbf{P}^{-1}\mathbf{x}_0 =\frac12\begin{bmatrix}1&1\\1&-1\end{bmatrix} \begin{bmatrix}2\\0\end{bmatrix} =\begin{bmatrix}1\\1\end{bmatrix}. $$ Therefore $$ \mathbf{x}_k=\mathbf{P}\mathbf{D}^k\mathbf{c} =\begin{bmatrix}1&1\\1&-1\end{bmatrix} \begin{bmatrix}3^k&0\\0&1\end{bmatrix} \begin{bmatrix}1\\1\end{bmatrix} =\begin{bmatrix}3^k+1\\3^k-1\end{bmatrix}. $$ This also gives \(\mathbf{x}_0=\begin{bmatrix}2\\0\end{bmatrix}\) when \(k=0\). To check the update, multiply the general state by \(\mathbf{A}\): $$ \mathbf{A}\mathbf{x}_k =\begin{bmatrix}2&1\\1&2\end{bmatrix} \begin{bmatrix}3^k+1\\3^k-1\end{bmatrix} =\begin{bmatrix}3^{k+1}+1\\3^{k+1}-1\end{bmatrix} =\mathbf{x}_{k+1}. $$ So the formula satisfies the initial condition and the system’s recurrence.

Worked Example: A Nonsymmetric Matrix with Distinct Eigenvalues

Consider $$ \mathbf{A}=\begin{bmatrix}4&1\\0&2\end{bmatrix}, \qquad \mathbf{x}_0=\begin{bmatrix}0\\1\end{bmatrix}. $$ Find the state after \(k\) steps. The vector \(\begin{bmatrix}1\\0\end{bmatrix}\) has eigenvalue \(4\), and \(\begin{bmatrix}1\\-2\end{bmatrix}\) has eigenvalue \(2\): multiplying by \(\mathbf{A}\) gives, respectively, \(\begin{bmatrix}4\\0\end{bmatrix}\) and \(\begin{bmatrix}2\\-4\end{bmatrix}\).

Set $$ \mathbf{P}=\begin{bmatrix}1&1\\0&-2\end{bmatrix}, \qquad \mathbf{D}=\begin{bmatrix}4&0\\0&2\end{bmatrix}, \qquad \mathbf{P}^{-1}=\begin{bmatrix}1&\frac12\\0&-\frac12\end{bmatrix}. $$ The inverse is verified by multiplying: $$ \mathbf{P}\mathbf{P}^{-1} =\begin{bmatrix}1&\frac12-\frac12\\0&1\end{bmatrix} =\mathbf{I}_2. $$ The diagonalization also checks directly: $$ \mathbf{P}\mathbf{D}\mathbf{P}^{-1} =\begin{bmatrix}4&2\\0&-4\end{bmatrix} \begin{bmatrix}1&\frac12\\0&-\frac12\end{bmatrix} =\begin{bmatrix}4&1\\0&2\end{bmatrix} =\mathbf{A}. $$ Convert the initial state to eigenvector coordinates: $$ \mathbf{c}=\mathbf{P}^{-1}\mathbf{x}_0 =\begin{bmatrix}\frac12\\-\frac12\end{bmatrix}. $$ Consequently, $$ \mathbf{x}_k =\mathbf{P}\mathbf{D}^k\mathbf{c} =\begin{bmatrix}1&1\\0&-2\end{bmatrix} \begin{bmatrix}4^k&0\\0&2^k\end{bmatrix} \begin{bmatrix}\frac12\\-\frac12\end{bmatrix} =\begin{bmatrix}\frac12(4^k-2^k)\\2^k\end{bmatrix}. $$ At \(k=0\), this is \(\begin{bmatrix}0\\1\end{bmatrix}\), as required. For the recurrence check, $$ \mathbf{A}\mathbf{x}_k =\begin{bmatrix}2(4^k-2^k)+2^k\\2\cdot2^k\end{bmatrix} =\begin{bmatrix}2\cdot4^k-2^k\\2^{k+1}\end{bmatrix} =\begin{bmatrix}\frac12(4^{k+1}-2^{k+1})\\2^{k+1}\end{bmatrix} =\mathbf{x}_{k+1}. $$ The expression therefore gives the state at every nonnegative integer step.

Worked Example: Three Eigenmodes in Three Coordinates

Let $$ \mathbf{A}=\begin{bmatrix}2&1&0\\0&3&1\\0&0&4\end{bmatrix}, \qquad \mathbf{x}_0=\begin{bmatrix}1\\0\\1\end{bmatrix}. $$ Use a diagonalization to find \(\mathbf{x}_k\). The eigenvalues \(2,3,4\) have respective eigenvectors \(\begin{bmatrix}1\\0\\0\end{bmatrix}\), \(\begin{bmatrix}1\\1\\0\end{bmatrix}\), and \(\begin{bmatrix}1\\2\\2\end{bmatrix}\). For example, multiplying the third vector by \(\mathbf{A}\) gives \(\begin{bmatrix}4\\8\\8\end{bmatrix}=4\begin{bmatrix}1\\2\\2\end{bmatrix}\). The same multiplication gives \(2\begin{bmatrix}1\\0\\0\end{bmatrix}\) and \(3\begin{bmatrix}1\\1\\0\end{bmatrix}\) for the first two.

Place these eigenvectors in the columns of \(\mathbf{P}\), and use their matching eigenvalues to form \(\mathbf{D}\): $$ \mathbf{P}=\begin{bmatrix}1&1&1\\0&1&2\\0&0&2\end{bmatrix}, \qquad \mathbf{D}=\begin{bmatrix}2&0&0\\0&3&0\\0&0&4\end{bmatrix}, \qquad \mathbf{P}^{-1}=\begin{bmatrix}1&-1&\frac12\\0&1&-1\\0&0&\frac12\end{bmatrix}. $$ Multiplying \(\mathbf{P}\mathbf{P}^{-1}\) gives diagonal entries \(1\) and off-diagonal entries \(0\), so the displayed inverse is correct. To check the diagonalization, first calculate \(\mathbf{P}\mathbf{D}=\begin{bmatrix}2&3&4\\0&3&8\\0&0&8\end{bmatrix}\). Then $$ \mathbf{P}\mathbf{D}\mathbf{P}^{-1} =\begin{bmatrix}2&3&4\\0&3&8\\0&0&8\end{bmatrix} \begin{bmatrix}1&-1&\frac12\\0&1&-1\\0&0&\frac12\end{bmatrix} =\begin{bmatrix}2&1&0\\0&3&1\\0&0&4\end{bmatrix} =\mathbf{A}. $$ The initial coordinates are $$ \mathbf{c}=\mathbf{P}^{-1}\mathbf{x}_0 =\begin{bmatrix}\frac32\\-1\\\frac12\end{bmatrix}. $$ Thus $$ \mathbf{x}_k =\mathbf{P}\mathbf{D}^k\mathbf{c} =\frac32\,2^k\begin{bmatrix}1\\0\\0\end{bmatrix} -3^k\begin{bmatrix}1\\1\\0\end{bmatrix} +\frac12\,4^k\begin{bmatrix}1\\2\\2\end{bmatrix} =\begin{bmatrix}\frac32\,2^k-3^k+\frac12\,4^k\\-3^k+4^k\\4^k\end{bmatrix}. $$ At \(k=0\), the coordinates give \(\begin{bmatrix}1\\0\\1\end{bmatrix}\). For a recurrence check, multiply the general expression by \(\mathbf{A}\). Its first entry becomes \(2(\frac32\,2^k-3^k+\frac12\,4^k)+(-3^k+4^k)=\frac32\,2^{k+1}-3^{k+1}+\frac12\,4^{k+1}\). Its second entry becomes \(3(-3^k+4^k)+4\cdot4^k=-3^{k+1}+4^{k+1}\), and its third entry is \(4\cdot4^k=4^{k+1}\). These are exactly the entries of \(\mathbf{x}_{k+1}\).

Common Pitfall: Leaving Out the Inverse

The formula is \(\mathbf{A}^k=\mathbf{P}\mathbf{D}^k\mathbf{P}^{-1}\), not \(\mathbf{P}\mathbf{D}^k\). The inverse is needed to convert from the original coordinates to eigenvector coordinates before applying the diagonal scaling; the factor \(\mathbf{P}\) then converts back. A concrete incorrect calculation using the first example would give $$ \mathbf{P}\mathbf{D} =\begin{bmatrix}1&1\\1&-1\end{bmatrix} \begin{bmatrix}3&0\\0&1\end{bmatrix} =\begin{bmatrix}3&1\\3&-1\end{bmatrix}, $$ which is not \(\mathbf{A}=\begin{bmatrix}2&1\\1&2\end{bmatrix}\). The correction is to include \(\mathbf{P}^{-1}\): $$ \mathbf{P}\mathbf{D}\mathbf{P}^{-1} =\frac12\begin{bmatrix}3&1\\3&-1\end{bmatrix} \begin{bmatrix}1&1\\1&-1\end{bmatrix} =\begin{bmatrix}2&1\\1&2\end{bmatrix}. $$ A second check is to substitute \(k=0\): the correct power formula gives \(\mathbf{P}\mathbf{I}\mathbf{P}^{-1}=\mathbf{I}\), whereas omitting the inverse would give \(\mathbf{P}\), which is generally not the identity.

When the Method Applies

The method calculates powers once a diagonalization is available; it does not guarantee that every real matrix has one over \(\mathbb{R}\). A proposed eigenvector matrix must be invertible, and the matching eigenvalues must be in the same order in \(\mathbf{D}\) as their eigenvectors are in \(\mathbf{P}\). In particular, an eigenvalue repeated on the diagonal must be paired with the correct eigenvector columns. If a real diagonalization has been established, the power formula needs no further restrictions on \(k\) beyond \(k\geq0\).

For a discrete system, this gives a direct route from an initial state to a state many steps later: compute the initial eigenvector coordinates once, raise the diagonal entries to the desired power, and convert back. The recurrence check \(\mathbf{A}\mathbf{x}_k=\mathbf{x}_{k+1}\) is a useful way to catch arithmetic or ordering errors. The long-term meaning of the eigenvalue magnitudes is a separate question; here the main task is exact computation of the state at a specified step.

Check Your Understanding

For each question, keep the order of eigenvectors and diagonal entries consistent, and verify any proposed state formula against the initial condition.

  1. If \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\), write the formula for \(\mathbf{A}^k\) and explain why it holds at \(k=0\).
  2. For \(\mathbf{D}=\begin{bmatrix}5&0\\0&-2\end{bmatrix}\), write \(\mathbf{D}^k\) for an integer \(k\geq1\).
  3. Suppose \(\mathbf{P}^{-1}\mathbf{x}_0=\begin{bmatrix}2\\-1\end{bmatrix}\) and \(\mathbf{D}=\begin{bmatrix}3&0\\0&1\end{bmatrix}\). Express \(\mathbf{x}_k\) in terms of the columns of \(\mathbf{P}\).
  4. For the matrix in the second worked example, calculate \(\mathbf{x}_2\) using its closed-form expression and verify that it equals \(\mathbf{A}\mathbf{x}_1\).
  5. What condition on \(\mathbf{P}\) is required for the factorization \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\) to be a diagonalization?

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