Lecture 36 - Diagonalizing a Matrix

Learning Objective

Diagonalization Process

Recall that an \( n\times n\) matrix \( A \) is diagonalizable if \( A = PDP^{-1} \) for some invertible matrix \( P \) and some diagonal matrix \( D \). The Diagonalization Theorem tells us that \( A \) diagonalizable if and only if there exist \( n \) linearly independent eigenvectors of \( A\). "Diagonalization" is the process by which we identify these \( n \) eigenvectors and use them to construct the matrices \( P \) and \( D\).

To diagonalize an \( n \times n\) matrix \( A \), follow these steps:

  1. Find the eigenvalues of \( A \)
  2. Find a basis for each eigenspace
  3. Construct \( P \) and \( D \) from the vectors and eigenvalues found in Step 2
  4. Check that \( A = PDP^{-1} \)

Examples

Example 1. Diagonalize \( A = \begin{bmatrix} 2 & -2 & -2 \\ 2 & -2 & -2 \\ 2 & -2 & -2 \end{bmatrix} \), if possible.

Step 1. To find the eigenvalues of \( A \), we solve the characteristic equation \( \det (A - \lambda I) = 0 \): \[ \det (A - \lambda I) = \det \begin{bmatrix} 2-\lambda & -2 & -2 \\ 2 & -2-\lambda & -2 \\ 2 & -2 & -2-\lambda \end{bmatrix} = -\lambda^3 - 2\lambda^2. \]

Setting this polynomial equal to zero gives two eigenvalues: \( \lambda = 0 \) and \( \lambda = -2 \).

Step 2. Now we find a basis for the eigenspace corresponding to each eigenvalue we found. Recall that the eigenspace is the null space of the matrix \( A - \lambda I \), so for each eigenvalue we solve the equation \( (A-\lambda I)\bbm x = \bbm 0 \) and write the solution in parametric form.

First, for \( \lambda = 0 \), we solve \( (A-0I)\bbm x = \bbm 0 \): \[ \begin{bmatrix} 2 & -2 & -2 & 0 \\ 2 & -2 & -2 & 0 \\ 2 & -2 & -2 & 0 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & -1 & -1 & 0 \\ 0 & 0& 0& 0 \\ 0& 0& 0& 0 \end{bmatrix} \]

The parametric form of the solution is \[ \bbm x = \vecthree {x_1} {x_2} {x_3} = x_2 \vecthree 110 + x_3 \vecthree 101. \]

Next, for \( \lambda = -2 \), we solve \( (A-(-2)I)\bbm x = \bbm 0 \): \[ \begin{bmatrix} 4 & -2 & -2 & 0 \\ 2 & 0 & -2 & 0 \\ 2 & -2 & 0 & 0 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & 0 & -1 & 0 \\ 0 & 1 & -1 & 0 \\ 0& 0& 0& 0 \end{bmatrix} \]

The parametric form of the solution is \[ \bbm x = \vecthree {x_1} {x_2} {x_3} = x_3 \vecthree 111. \]

Step 3. We have found three linearly independent eigenvectors for \( A \). The two vectors in the eigenspace basis for \( \lambda = 0 \) are linearly independent due to the nature of a basis, and the different bases are linearly independent from each other by the Eigenvectors for Distinct Eigenvalues Theorem from Lecture 33.

The columns of \( P \) are the eigenvectors we found, and the diagonal entries of \( D \) are the corresponding eigenvalues. We can arrange the columns of \( P \) in any order as long as we keep the diagonal entries of \( D \) in the corresponding order. One way to do this is: \[ P = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 0 & 1 \\ 0 & 1 & 1 \end{bmatrix} \quad \mbox{and} \quad D = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & -2 \end{bmatrix}. \]

We can verify that \( A = PDP^{-1} \). \( \Box \)

Example 2. Diagonalize \( B = \begin{bmatrix} 1 & -1 & -2 \\ 1 & -1 & -2 \\ 2 & -2 & -2 \end{bmatrix} \), if possible.

Step 1. To find the eigenvalues of \( B \), we solve the characteristic equation \( \det (B - \lambda I) = 0 \): \[ \det (B - \lambda I) = \det \begin{bmatrix} 1-\lambda & -1 & -2 \\ 1 & -1-\lambda & -2 \\ 2 & -2 & -2-\lambda \end{bmatrix} = -\lambda^3 - 2\lambda^2. \]

Setting this polynomial equal to zero gives two eigenvalues: \( \lambda = 0 \) and \( \lambda = -2 \). Notice that \( B \) has the same characteristic polynomial and eigenvalues as \( A \).

Step 2. First, for \( \lambda = 0 \), we solve \( (B-0I)\bbm x = \bbm 0 \): \[ \begin{bmatrix} 1 & -1 & -2 & 0 \\ 1 & -1 & -2 & 0 \\ 2 & -2 & -2 & 0 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0& 0& 0& 0 \end{bmatrix} \]

The parametric form of the solution is \[ \bbm x = \vecthree {x_1} {x_2} {x_3} = x_2 \vecthree 110. \]

Next, for \( \lambda = -2 \), we solve \( (B-(-2)I)\bbm x = \bbm 0 \): \[ \begin{bmatrix} 3 & -1 & -2 & 0 \\ 1 & 1 & -2 & 0 \\ 2 & -2 & 0 & 0 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & 0 & -1 & 0 \\ 0 & 1 & -1 & 0 \\ 0& 0& 0& 0 \end{bmatrix} \]

The parametric form of the solution is \[ \bbm x = \vecthree {x_1} {x_2} {x_3} = x_3 \vecthree 111. \]

There are no other eigenvalues, and so there is no way to find any more eigenvectors that are not just multiples of the vectors we have already found. Since we only found two linearly independent eigenvectors and \( B \) is \( 3 \times 3\), we conclude that \( B \) is not diagonalizable. \( \Box \)

A Sufficient Condition for Diagonalizability

These examples illustrate that you can't always tell from the characteristic polynomial whether a matrix is diagonalizable. However, there is a specific situation in which the polynomial and its roots can tell us that the matrix is diagonalizable.

Theorem. If an \( n \times n\) matrix \( A \) has \( n \) distinct eigenvalues, then \( A \) is diagonalizable.

Proof. Let \( \lambda_1, \ldots, \lambda_n \) be the distinct eigenvalues of \( A \). By definition, there is at least one nonzero vector \( \bbm v_i \) that is an eigenvector for each \( \lambda_i \). The Eigenvectors for Distinct Eigenvalues Theorem implies that the set \( \{ \bbm v_1, \ldots, \bbm v_n \} \) is linearly independent. Since this is a set of \( n \) linearly independent eigenvectors of \( A \), the Diagonalization Theorem tells us that \( A \) is diagonalizable. \( \Box \)

Note that it is not necessary for an \( n\times n\) matrix \( A \) to have \( n\) eigenvalues in order to be diagonalizable. Example 1 illustrates this, since in that example \( A \) is a \(3 \times 3\) matrix with only 2 distinct eigenvalues, yet \( A \) is diagonalizable.

Example 3. Let \( C = \begin{bmatrix} 2 & 0 & -1 \\ 1 & -1 & 2 \\ -1 & 0 & 1 \end{bmatrix} \). Determine whether \( C \) is diagonalizable.

To find the eigenvalues of \( C \), we solve \( \det (C-\lambda I) = 0\): \[ \det (C-\lambda I) = \det \begin{bmatrix} 2-\lambda & 0 & -1 \\ 1 & -1-\lambda & 2 \\ -1 & 0 & 1-\lambda \end{bmatrix} = -\lambda^3 +2\lambda^2 + 2\lambda - 1. \]

It is difficult, in general, to solve cubic equations by hand. We can use technology to find the roots of this polynomial, or we can choose to calculate the determinant using the second column, which gives the partially-factored polynomial \( \det(C-\lambda I) = (-1-\lambda)(\lambda^2-3\lambda+1) \). Either way, we get three eigenvalues: \( \lambda = -1, \lambda = \frac{3+\sqrt 5}{2} \), and \( \lambda = \frac{3-\sqrt 5}{2} \).

Since \( C \) is \( 3 \times 3\) and has three distinct eigenvalues, we conclude that \( C \) is diagonalizable. \( \Box \)

« Lecture 35 Back to Top Lecture 37 »