Diagonalizable Matrices and Multiplicity

Recall that a diagonal matrix \(D\) is a matrix containing a zero in every entry except those on the main diagonal. More precisely, if \(d_{ij}\) is the \(ij^{th}\) entry of a diagonal matrix \(D\), then \(d_{ij}=0\) unless \(i=j\). Such matrices look like the following.

\begin{equation*} D = \begin{bmatrix} * & & 0 \\ & \ddots & \\ 0 & & * \end{bmatrix} \end{equation*}

where \(*\) is a number which might not be zero.

Diagonal matrices have some nice properties, as we demonstrate below.

Let \(M =\begin{bmatrix}1 & 2 & 3\\ 4&5&6\\7&8&9\end{bmatrix}\) and let \(D =\begin{bmatrix}2 & 0 & 0\\ 0&-5&0\\0&0&10\end{bmatrix}\). Compute \(MD\) and \(DM\) using Octave.
% Define M
M=[1 2 3; 4 5 6; 7 8 9]

% The function diag(vector) creates a square matrix with diagonal
%vector and the remaining entries zero.
D=diag([2 -5 10])

% The function diag() can also be used to return the diagonal of a matrix.
diag_M=diag(M)

% Understanding multiplication by a diagonal matrix
product_MD=M*D
product_DM=D*M

% Raising a diagonal matrix to a power
D5=D^5

Link to code.

Notice the patterns present in the product matrices.

  • Each row of \(DM\) is the same as its corresponding row of \(M\) multiplied by the scalar which is the corresponding diagonal element of \(D\).
  • In the product \(MD\), it is the columns of \(M\) that have been multiplied by the diagonal elements.
  • Raising \(D\) to the \(5^{th}\) power amounts to raising each diagonal element to the \(5^{th}\) power.

These patterns hold in general for any diagonal matrix, and they are fundamental to understanding diagonalization and its uses. We discuss diagonalization next.

If we are given a matrix \(A\) that is diagonalizable, then we can write \(P^{-1}AP=D\) for some matrix \(P\), or, equivalently,

\begin{equation}\label {eq:understand_diag} AP=PD \end{equation}

If we pause to examine Equation (eq:understand_diag), the work that we did in Exploration init:multiplydiag can help us to understand how to find \(P\) that will diagonalize \(A\). The product \(PD\) is formed by multiplying each column of \(P\) by a scalar which is the corresponding element on the diagonal of \(D\). To restate this, if \(\vec {x}_i\) is column \(i\) in our matrix \(P\), then Equation (eq:understand_diag) tells us that

\begin{equation}\label {eq:ev_ew_diag} A \vec {x}_i = \lambda _i \vec {x}_i, \end{equation}

where \(\lambda _i\) is the \(i\)th diagonal element of \(D\).

Of course, Equation (eq:ev_ew_diag) is very familiar! We see that if we are able to diagonalize a matrix \(A\), the columns of matrix \(P\) will be the eigenvectors of \(A\), and the corresponding diagonal entries of \(D\) will be the corresponding eigenvalues of \(A\). This is summed up in the following theorem.

Suppose \(P\) is given as above as an invertible matrix whose columns are eigenvectors of \(A\). To show that \(A\) is diagonalizable, we will show

\[AP=PD,\]
which is equivalent to \(P^{-1}AP=D\). We have
\[AP=\begin{bmatrix} | & | & & | \\ A\vec {x}_1 & A\vec {x}_2 & \cdots & A\vec {x}_n \\ | & | & & | \end{bmatrix},\]
while
\begin{equation*} PD=\begin{bmatrix} | & | & & | \\ \vec {x}_1 & \vec {x}_2 & \cdots & \vec {x}_n \\ | & | & & | \end{bmatrix} \begin{bmatrix} \lambda _{1} & & 0 \\ & \ddots & \\ 0 & & \lambda _{n} \end{bmatrix}=\begin{bmatrix} | & | & & | \\ \lambda _{1}\vec {x}_1 & \lambda _{2}\vec {x}_2 & \cdots & \lambda _{n}\vec {x}_n \\ | & | & & | \end{bmatrix} \end{equation*}
We can complete this half of the proof by comparing columns, and noting that
\begin{equation} A \vec {x}_i = \lambda _i \vec {x}_i \end{equation}
for \(i=1,\ldots ,n\) since the \( \vec {x}_i\) are eigenvectors of \(A\) and the \(\lambda _i\) are corresponding eigenvalues of \(A\).

Conversely, suppose \(A\) is diagonalizable so that \(P^{-1}AP=D.\) Let

\begin{equation*} P=\begin{bmatrix} | & | & & | \\ \vec {x}_1 & \vec {x}_2 & \cdots & \vec {x}_n \\ | & | & & | \end{bmatrix} \end{equation*}
where the columns are the vectors \(\vec {x}_i\) and
\begin{equation*} D=\begin{bmatrix} \lambda _{1} & & 0 \\ & \ddots & \\ 0 & & \lambda _{n} \end{bmatrix} \end{equation*}
Then
\begin{equation*} AP=PD=\begin{bmatrix} | & | & & | \\ \vec {x}_1 & \vec {x}_2 & \cdots & \vec {x}_n \\ | & | & & | \end{bmatrix} \begin{bmatrix} \lambda _{1} & & 0 \\ & \ddots & \\ 0 & & \lambda _{n} \end{bmatrix} \end{equation*}
and so
\begin{equation*} \begin{bmatrix} | & | & & | \\ A\vec {x}_1 & A\vec {x}_2 & \cdots & A\vec {x}_n \\ | & | & & | \end{bmatrix} =\begin{bmatrix} | & | & & | \\ \lambda _{1}\vec {x}_1 & \lambda _{2}\vec {x}_2 & \cdots & \lambda _{n}\vec {x}_n \\ | & | & & | \end{bmatrix} \end{equation*}
showing the \(\vec {x}_i\) are eigenvectors of \(A\) and the \(\lambda _{i}\) are eigenvalues.

Notice that because the matrix \(P\) defined above is invertible it follows that the set of eigenvectors of \(A\), \(\left \{ \vec {x}_1 , \vec {x}_2 , \ldots , , \vec {x}_n \right \}\), is a basis of \(\mathbb {R}^n\).

We demonstrate the concept given in the above theorem in the next example. Note that not only are the columns of the matrix \(P\) formed by eigenvectors, but \(P\) must be invertible, and therefore must consist of a linearly independent set of eigenvectors.

We will continue to use matrices from Example ex:diagonalizematrix to illustrate why diagonalizable matrices are easier to work with. Let \(A=\begin{bmatrix} 2 & 0 & 0 \\ 1 & 4 & -1 \\ -2 & -4 & 4 \end{bmatrix}\) and let \(D=\begin{bmatrix} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 6 \end{bmatrix}\). Would it be easier to compute \(A^5\) or \(D^5\) if you had to do so by hand, without a computer? Certainly \(D^5\) is easier, due to the number of zero entries!

Raising a diagonal matrix to a power amounts to simply raising each entry to that same power, whereas computing \(A^5\) requires many more calculations. However, we learned in Example ex:diagonalizematrix that \(A\) is similar to \(D\). We will use this to make our computation easier as follows

\begin{align*} A^5&=\left (PDP^{-1}\right )^5 \\ &=(PDP^{-1})(PDP^{-1})(PDP^{-1})(PDP^{-1})(PDP^{-1}) \\ &=PD(P^{-1}P)D(P^{-1}P)D(P^{-1}P)D(P^{-1}P)DP^{-1} \\ &=PD(I)D(I)D(I)D(I)DP^{-1} \\ &=PD^5P^{-1} \end{align*}

With this in mind, it is not as daunting to calculate \(A^5\) by hand.

\[A^5=\begin{bmatrix} -2 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & -2 \end{bmatrix}\begin{bmatrix}32 & 0 & 0\\0 &32 & 0\\0 & 0 & 7776\end{bmatrix}\begin{bmatrix} -1/4 & 1/2 & 1/4 \\ 1/2 & 1 & 1/2 \\ 1/4 & 1/2 & -1/4 \end{bmatrix}=\begin{bmatrix}32 & 0 & 0\\ 1936 & 3904 & -1936\\ -3872 & -7744 & 3904\end{bmatrix}\]
The savings in work would certainly be more pronounced for larger matrices or for powers larger that 5.

In Exploration exp:motivate_diagonalization, because matrix \(A\) was diagonalizable, we were able to cut down on computations. When we chose to work with \(D\) and \(P\) instead of \(A\) we worked with the eigenvalues and eigenvectors of \(A\). Each column of \(P\) is an eigenvector of \(A\), and so we repeatedly made use of the following theorem (with \(m=5\)).

We prove this theorem by induction on \(m\). Clearly \(A^m \vec {x} = \lambda ^m \vec {x}\) holds when \(m=1\), as that was given. For the inductive step, suppose that we know \(A^{m-1} \vec {x} = \lambda ^{m-1} \vec {x}\). Then

\begin{align*} A^m \vec {x} &= (A A^{m-1}) \vec {x} \\ &= A (A^{m-1} \vec {x}) \\ &= A (\lambda ^{m-1} \vec {x}) \\ &= \lambda ^{m-1} A\vec {x} \\ &= \lambda ^{m-1} \lambda \vec {x} \\ &= \lambda ^m \vec {x} \end{align*}

as desired.

Matrix \(A\) from the Example ex:diagonalizematrix and Exploration exp:motivate_diagonalization had a repeated eigenvalue of 2. The next theorem and corollary show that matrices which have distinct eigenvalues (where none are repeated) have desirable properties.

We prove this by induction on \(m\), the number of vectors in the set. If \(m = 1\), then \(\{\vec {x}_{1}\}\) is a linearly independent set because \(\vec {x}_{1} \neq \vec {0}\). In general, suppose we have established that the theorem is true for some \(m \geq 1\). Given eigenvectors \(\{\vec {x}_{1}, \vec {x}_{2}, \dots , \vec {x}_{m+1}\}\), suppose

\begin{equation} \label {eq:thm_proof_5_5_4_1} c_1\vec {x}_1 + c_2\vec {x}_2 + \dots + c_{m+1}\vec {x}_{m+1} = \vec {0}. \end{equation}
We must show that each \(c_{i} = 0\). Multiply both sides of (eq:thm_proof_5_5_4_1) on the left by \(A\) and use the fact that \(A\vec {x}_{i} = \lambda _{i}\vec {x}_{i}\) to get
\begin{equation} \label {eq:thm_proof_5_5_4_2} c_1\lambda _1\vec {x}_1 + c_2\lambda _2\vec {x}_2 + \dots + c_{m+1}\lambda _{m+1}\vec {x}_{m+1} = \vec {0}. \end{equation}
If we multiply (eq:thm_proof_5_5_4_1) by \(\lambda _{1}\) and subtract the result from (eq:thm_proof_5_5_4_2), the first terms cancel and we obtain
\begin{equation*} c_2(\lambda _2 - \lambda _1)\vec {x}_2 + c_3(\lambda _3 - \lambda _1)\vec {x}_3 + \dots + c_{m+1}(\lambda _{m+1} - \lambda _1)\vec {x}_{m+1} = \vec {0}. \end{equation*}
Since \(\vec {x}_{2}, \vec {x}_{3}, \dots , \vec {x}_{m+1}\) correspond to distinct eigenvalues \(\lambda _{2}, \lambda _{3}, \dots , \lambda _{m+1}\), the set \(\{\vec {x}_{2}, \vec {x}_{3}, \dots , \vec {x}_{m+1}\}\) is linearly independent by the induction hypothesis. Hence,
\begin{equation*} c_2(\lambda _2 - \lambda _1) = 0, \quad c_3(\lambda _3 - \lambda _1) = 0, \quad \dots , \quad c_{m+1}(\lambda _{m+1} - \lambda _1) = 0 \end{equation*}
and so \(c_{2} = c_{3} = \dots = c_{m+1} = 0\) because the \(\lambda _{i}\) are distinct. It follows that (eq:thm_proof_5_5_4_1) becomes \(c_{1}\vec {x}_{1} = \vec {0}\), which implies that \(c_{1} = 0\) because \(\vec {x}_{1} \neq \vec {0}\), and the proof is complete.

The corollary that follows from this theorem gives a useful tool in determining if \(A\) is diagonalizable.

Not every matrix has an eigenvalue decomposition. Sometimes we cannot find an invertible matrix \(P\) such that \(P^{-1}AP=D\). Consider the following example.

We saw earlier in Corollary th:distincteigenvalues that an \(n \times n\) matrix with \(n\) distinct eigenvalues is diagonalizable. It turns out that there are other useful diagonalizability tests.

Recall that the algebraic multiplicity of an eigenvalue \(\lambda \) is the number of times that it occurs as a root of the characteristic polynomial.

Consider now the following lemma.

In other words, the geometric multiplicity of an eigenvalue is less than or equal to the algebraic multiplicity of that same eigenvalue.

Let \(k\) be the geometric multiplicity of \(\lambda _1\), i.e., \(k=\mbox {dim}(\mathcal {S}_{\lambda _1})\). Suppose \(\left \{\vec {x}_1, \vec {x}_2, \ldots ,\vec {x}_k\right \}\) is a basis for the eigenspace \(\mathcal {S}_{\lambda _1}\). Let \(P\) be any invertible matrix having \(\vec {x}_1, \vec {x}_2, \ldots ,\vec {x}_k\) as its first \(k\) columns, say

\[P=\begin{bmatrix} | & | & & | & | & & | \\ \vec {x}_1 & \vec {x}_2 & \cdots & \vec {x}_k & \vec {x}_{k+1} & \cdots & \vec {x}_n \\ | & | & & | & | & & | \end{bmatrix}.\]
In block form we may write
\[P=\begin{bmatrix} B&C \end{bmatrix} \quad \text {and} \quad P^{-1}=\begin{bmatrix} D \\ E \end{bmatrix}\]
where \(B\) is \(n \times k\), \(C\) is \(n \times (n-k)\), \(D\) is \(k \times n\), and \(E\) is \((n-k) \times n\). We observe \(I_n = P^{-1}P = \left [\begin{array}{c|c} DB & DC \\ \hline EB & EC \end{array}\right ] \). This implies
\[DB = I_k,\quad DC=O_{k\,\,n-k},\quad EB = O_{n-k\,\,k} \quad \text { and }\quad EC = I_{n-k}\]
Therefore,
\begin{equation*} P^{-1}AP=\begin{bmatrix} D \\ E \end{bmatrix} A \begin{bmatrix} B&C \end{bmatrix} = \left [\begin{array}{c|c} DAB & DAC \\ \hline EAB & EAC \end{array}\right ] \end{equation*}
\begin{equation*} = \left [\begin{array}{c|c} \lambda _1 DB & DAC \\ \hline \lambda _1 EB & EAC \end{array}\right ] = \left [\begin{array}{c|c} \lambda _1 I_k & DAC \\ \hline O & EAC \end{array}\right ] \end{equation*}
We finish the proof by comparing the characteristic polynomials on both sides of this equation, and making use of the fact that similar matrices have the same characteristic polynomials.
\[\det (A-\lambda I) = \det (P^{-1}AP-\lambda I)=(\lambda _1 - \lambda )^k \det (EAC)\]
We see that the characteristic polynomial of \(A\) has \((\lambda _1 - \lambda )^k\) as a factor. This tells us that algebraic multiplicity of \(\lambda _1\) is at least \(k\), proving the desired inequality.

This result tells us that if \(\lambda \) is an eigenvalue of \(A\), then the number of linearly independent \(\lambda \)-eigenvectors is never more than the multiplicity of \(\lambda \). We now use this fact to provide a useful diagonalizability condition.

Suppose \(A\) is diagonalizable and let \(\lambda _1, \ldots , \lambda _t\) be the distinct eigenvalues of \(A\), with algebraic multiplicities \(m_1, \ldots , m_t\), respectively and geometric multiplicities \(k_1, \ldots , k_t\), respectively. Since \(A\) is diagonalizable, Theorem th:eigenvectorsanddiagonalizable implies that \( k_1+\cdots +k_t=n\). By applying Lemma lemma:dimeigenspace \(t\) times, we have

\[n = k_1+\cdots +k_t \le m_1+\cdots +m_t = n,\]
which is only possible if \(k_i=m_i\) for \(i=1,\ldots ,t\).

Conversely, if the geometric multiplicity equals the algebraic multiplicity of each eigenvalue, then obtaining a basis for each eigenspace yields \(n\) eigenvectors. Applying Theorem th:linindepeigenvectors, we know that these \(n\) eigenvectors are linearly independent, so Theorem th:eigenvectorsanddiagonalizable implies that \(A\) is diagonalizable.

Practice Problems

Fill in the details of Example 4.
Find the eigenvalues of matrix
\begin{equation*} A=\begin{bmatrix} 2 & 0 & 0 \\ 1 & 4 & -1 \\ -2 & -4 & 4 \end{bmatrix} \end{equation*}
Find a basis for each eigenspace of the matrix \(A\).
Compute the inverse of
\begin{equation*} P= \begin{bmatrix} -2 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & -2 \end{bmatrix} \end{equation*}
Compute \(D=P^{-1}AP\)
Show that computing the inverse of \(P\) is not really necessary by comparing the products \(PD\) and \(AP\).
Let \(A=\begin{bmatrix}4 & -1\\-3 & 2\end{bmatrix}\)
Find the eigenvalues of \(A\) and list them in increasing order.
\[\lambda _1=\answer {1},\quad \lambda _2=\answer {5}\]
Find a diagonalization for \(A\)
\[\begin{bmatrix}\lambda _1 & 0\\0 & \lambda _2\end{bmatrix}=P^{-1}AP=\frac {1}{4}\begin{bmatrix}1 & \answer {1}\\\answer {-3} & 1\end{bmatrix}\begin{bmatrix}4 & -1\\-3 & 2\end{bmatrix}\begin{bmatrix}1 &\answer {-1}\\\answer {3} & 1\end{bmatrix}\]
Find \(A^6\).
\[A^6=\begin{bmatrix}\answer {11719} & \answer {-3906}\\\answer {-11718} & \answer {3907}\end{bmatrix}\]
Explain why the shearing matrix \(\begin{bmatrix}1 & k\\0 & 1\end{bmatrix}\), where \(k\neq 0\) is not diagonalizable.
Let
\[A=\begin{bmatrix} 1 & 0 & 0 \\ 1 & 2 & 1 \\ 0 & 0 & 1 \end{bmatrix}\]
Find eigenvalues of \(A\) and list them in increasing order.
\[\lambda _1=\answer {1},\quad \lambda _2=\answer {1},\quad \lambda _3=\answer {2}\]
Find a diagonalization for \(A\).
\[\begin{bmatrix}\lambda _1 & 0 & 0\\0 & \lambda _2 & 0\\0 & 0 & \lambda _3\end{bmatrix}=P^{-1}AP=\begin{bmatrix}\answer {-1} & \answer {0} &\answer {-1}\\0&0&1\\\answer {1} & \answer {1}&\answer {1}\end{bmatrix}\begin{bmatrix} 1 & 0 & 0 \\ 1 & 2 & 1 \\ 0 & 0 & 1 \end{bmatrix}\begin{bmatrix}\answer {-1} & \answer {-1} & \answer {0}\\1 & \answer {0} & 1\\\answer {0} &1 & \answer {0}\end{bmatrix}\]
Let
\[A=\begin{bmatrix} 4 & 0 & 0 \\ 0 & 2 & 2 \\ 2 & 3 & 1 \end{bmatrix}\]

\(\lambda _1=4\) is an eigenvalue of algebraic multiplicity \(\answer {2}\).

\[\mathcal {S}_{\lambda _1}=\text {span}\left (\begin{bmatrix}\answer {0}\\\answer {1}\\1\end{bmatrix}\right )\]

Geometric multiplicity of \(\lambda _1\) is \(\answer {1}\).

Explain why \(A\) is not diagonalizable.

Let \(A\) denote an \(n \times n\) upper triangular matrix. If all the main diagonal entries of \(A\) are distinct, show that \(A\) is diagonalizable.
Let \(A\) be a diagonalizable \(n \times n\) matrix with eigenvalues \(\lambda _{1}, \lambda _{2}, \dots , \lambda _{n}\) (including multiplicities). Show that:
(a)
\(\det A = \lambda _{1}\lambda _{2}\cdots \lambda _{n}\)
(b)
\(\mbox {tr} A = \lambda _{1} + \lambda _{2} + \cdots + \lambda _{n}\)

Text Source

The text in this section is a compilation of material from Section 7.2.1 of Ken Kuttler’s A First Course in Linear Algebra (CC-BY) and Section 5.5 of Keith Nicholson’s Linear Algebra with Applications (CC-BY-NC-SA).

Ken Kuttler, A First Course in Linear Algebra, Lyryx 2017, Open Edition, p. 362-364.

Many of the Practice Problems are Exercises from W. Keith Nicholson, Linear Algebra with Applications, Lyryx 2018, Open Edition, pp. 298-310.