# Section 4.5 Similarity and Diagonalization

Definition: If $A$ and $B$ are $n\times n$ matrices, then $A$ is similar to $B$ if there is an invertible matrix $P$ such that $P^{-1}AP=B$ or $A=PBP^{-1}$. We write $A\sim B$.

Remark: We can write $Q=P^{-1}$ because $P$ is invertible then we have $QAQ^{-1}=B$, i.e. $Q^{-1}BQ=A$ and $B$ is similar to $A$. Changing $A$ into $P^{-1}AP=B$ is called a similarity transformation.

Example 1: If $A$ is similar to $B$ and either $A$ or $B$ is diagonalizable, show that the other is also diagonalizable.

Exercise 1: Show that if $A$ is similar to $B$ then $\mbox{det}A=\mbox{det}B$.

Theorem: If matrices $A$ and $B$ are similar, then they have the same characteristic
polynomial and hence the same eigenvalues (with the same multiplicities).

Remark: 1. Unfortunately, the converse of the theorem is not true. For example $A=\left[\begin{array}{cc} 1 & 2\\ 0 & 3 \end{array}\right]$ and $B=\left[\begin{array}{cc} 1 & 0\\ 0 & 3 \end{array}\right]$ have the same characteristic polynomial but they are not similar.

2. Two matrices that are row equivalent do not mean they are similar to each other. For example $B=EA$ where $E$ is just elementary matrix, and it does not mean $A$ is similar to $B$. Therefore, we cannot use row reduction to get the eigenvalues.

Theorem: If $A$ and $B$ are similar $n\times n$ matrices, then $A$ and $B$ have the same determinant, rank, characteristic polynomial, and eigenvalues.

Remark: 1. A square matrix $A$ is diagonalizable then there exists an invertible matrix $P$ such that $P^{-1}AP=D$ is a diagonal matrix, that is $A$ is similar to a diagonal matrix $D$.

2.The set of all solutions of $(A-\lambda I)\overrightarrow{x}=0$ is just the null space of the matrix $A-\lambda I$. So this set is a subspace of $\mathbb{R}^{n}$ and is called the eigenspace of $A$ corresponding to $\lambda$. The eigenspace consists of the zero vector and all the eigenvectors corresponding to $\lambda$.

3. If $\overrightarrow{x}$ is in the eigenspace of some eigenvalue $\lambda$, then $A\overrightarrow{x}$ is just a scalar of $\overrightarrow{x}$. This is saying the transformation defined by $A$ transforms the eigenspace into scalar multiple of itself.

Theorem: If $\overrightarrow{v_{1}},...,\overrightarrow{v_{p}}$ are eigenvectors that correspond to distinct eigenvalues $\lambda_{1},...,\lambda_{p}$ of an matrix $A$, then the set $\{\overrightarrow{v_{1}},...,\overrightarrow{v_{p}}\}$ is linearly independent.

Theorem: An $n\times n$ matrix $A$ is diagonalizable if and only if $A$ has $n$ linearly independent eigenvectors.

Remark: $A$ is diagonalizable if and only if there are enough eigenvectors to form a basis of $\mathbb{R}^{n}$. We call such a basis an eigenvector basis of $\mathbb{R}^{n}$.

Theorem: Let $A$ be a matrix whose distinct eigenvalues are $\lambda_{1},....,\lambda_{p}$.

a. For $1\leq k\leq p$, the dimension of the eigenspace for $\lambda_{k}$ is less than or equal to the
multiplicity of the eigenvalue $\lambda_{k}$.

b. The matrix $A$ is diagonalizable if and only if the sum of the dimensions of the eigenspaces equals $n$, and this happens if and only if (i) the characteristic polynomial factors completely into linear factors and (ii) the dimension of the eigenspace for each $\lambda_{k}$ equals the multiplicity of $\lambda_{k}$.

c. If $A$ is diagonalizable and $B_{k}$ is a basis for the eigenspace corresponding to $\lambda_{k}$
for each $k$, then the total collection of vectors in the sets $B_{1},...,B_{p}$ forms an eigenvector basis for $\mathbb{R}^{n}$.

Example 2: Diagonalize the following matrix, if possible.

$A=\left[\begin{array}{cccc} 1 & 1 & 4 & 0\\ 0 & 1 & 1 & 6\\ 0 & 0 & -2 & 1\\ 0 & 0 & 0 & -2 \end{array}\right]$

Exercise 2: Diagonalize the following matrix, if possible.

$A=\left[\begin{array}{cccc} 3 & 0 & 0 & 0\\ 1 & -1 & 0 & 0\\ 0 & 1 & 2 & 0\\ 1 & 0 & 2 & -1 \end{array}\right]$

Example 3: Diagonalize the following matrix, if possible.

$A=\left[\begin{array}{ccc} 3 & 0 & 6\\ 0 & -3 & 0\\ 5 & 0 & 2 \end{array}\right]$

Exercise 3: Diagonalize the following matrix, if possible.

$A=\left[\begin{array}{ccc} 4 & 0 & 0\\ 0 & 2 & 2\\ 2 & 3 & 1 \end{array}\right]$

Group Work 1: True or False. All matrices are $n\times n$ matrices.

a. $A$ is diagonalizable with eigenvalues $\lambda_{1},...,\lambda_{n}$ then $\text{det}A=\lambda_{1}\cdots\lambda_{n}$.

b. If $\mathbb{R}^{n}$ has a basis of eigenvectors of $A$, then $A$ is diagonalizable.

c. $A$ is diagonalizable if and only if $A$ has $n$ eigenvalues, counting multiplicities.

d. If $A$ is invertible, then $A$ is diagonalizable.

e. An eigenspace of $A$ is a null space of a certain matrix.

Group Work 2: $A$ is a $6\times6$ matrix with two eigenvalues. One eigenspace is 4-dimensional, and the other eigenspace is 2-dimensional. Is $A$ diagonalizable? Why?

Group Work 3: If $A$ is an $n\times n$ matrix with $n$ distinct eigenvalues, show $A$ is diagonalizable.

Group Work 4: Show that if $A$ is diagonalizable then $A$ is similar to $A^{T}$.

Group Work 5: True or False. All matrices are $n\times n$ matrices. Justify each answer.

a. $A$ is diagonalizable if $A$ has $n$ eigenvectors.

b. $A$ is diagonalizable if $A$ has $n$ distinct eigenvectors.

c. $A\sim B$, then $\text{det}(A-xI)=\text{det}(B-xI)$.

d. $A$ is diagonalizable, then $A$ is invertible.

e. If $A$ is diagonalizable then $A$ is similar to $A^{T}$.

Group Work 6: Let $A$ be an $3\times3$ matrix with 2 eigenvalues. Each eigenspace is one-dimensional. Is $A$ diagonalizable?
Why?

Group Work7: $A$ is a $5\times5$ matrix with $3$ eigenvalues. Two of the eigenspaces are 2-dimensional. Is it possible that $A$ is not diagonalizable?