# Showing that two matrices are similar by showing they are similar to the same diagonal matrix

The exercise gives two matrices $A$ and $B$ and asks you to show they are similar by showing that they are similar to the same diagonal matrix, and then after that find and invertible matrix $P$ such that $P^{-1}AP=B$.

$$A = \begin{bmatrix} 1 & 0 & 2\\[0.3em] 1 & -1 & 1\\[0.3em] 2 & 0 & 1\\[0.3em] \end{bmatrix}, % B = \begin{bmatrix} -3 & -2 & 0\\[0.3em] 6 & 5 & 0\\[0.3em] 4 & 4 & -1\\[0.3em] \end{bmatrix}$$

I started with with calculating the eigenvalues of matrix $A$ like so: $$det(A) = det(\begin{bmatrix} 1-\lambda & 0 & 2\\[0.3em] 1 & -1-\lambda & 1\\[0.3em] 2 & 0 & 1-\lambda\\[0.3em] \end{bmatrix})= \lambda^3-\lambda^2-5\lambda-3 = (\lambda-3)(\lambda+1)^2$$

Which gives $\lambda = -1, 3$. Taking $\lambda = -1$ gives $$[A--1 \cdot I|0] = \begin{bmatrix} 2 & 0 & 2 & 0\\[0.3em] 1 & 0 & 1 & 0\\[0.3em] 2 & 0 & 2 & 0\\[0.3em] \end{bmatrix}= % \begin{bmatrix} 1 & 0 & 1 & 0\\[0.3em] 0 & 0 & 0 & 0\\[0.3em] 0 & 0 & 0 & 0\\[0.3em] \end{bmatrix}$$

But this is where I get stuck, because $x_2$ is a free variable, and so this gives

$$E_{-1}=\Bigg\{s \begin{bmatrix} 0\\[0.3em] 1\\[0.3em] 0\\[0.3em] \end{bmatrix}+ % t\begin{bmatrix} -1\\[0.3em] 0\\[0.3em] 1\\[0.3em] \end{bmatrix}\Bigg\} = span % \Bigg(\begin{bmatrix} 0\\[0.3em] 1\\[0.3em] 0\\[0.3em] \end{bmatrix}, % \begin{bmatrix} -1\\[0.3em] 0\\[0.3em] 1\\[0.3em] \end{bmatrix} \Bigg)$$ right? I thought $P =\{E_{-1}, E_{-1}, E_{3}\}$ for example, so how does this work? I might be completely missing the mark, but I thought you had to calculate the eigenvalues of matrix $A$ and $B$, and if they are the same, then they are similar, then after this, calculate the eigenvectors of matrix $A$ to obtain matrix $P$, and then plug these matrices into the formula given above ($P^{-1}AP=B$) to see if it's true or not?

I uploaded pictures of how I've done it here, is that the correct way?

• Why are you stuck? You seem to have just stopped rather than continuing doing precisely what you say you think you should be doing. – Tobias Kildetoft Mar 9 '16 at 20:32
• @TobiasKildetoft I thought $E_{-1}$ was supposed to be 1 vector, so then I must have done something wrong. Should I just continue with $\lambda = 3$ and then use that together with $E_{-1}$ to obtain matrix $P$? – Esoemah Mar 9 '16 at 20:34
• Why should it be just one vector? You only have two eigenvalues, so you need two eigenvectors from one of them to be able to diagonalize. – Tobias Kildetoft Mar 9 '16 at 20:36
• @TobiasKildetoft Okay thanks, I must have been confused for some reason. Is my reasoning at the bottom correct and should I just continue with that? – Esoemah Mar 9 '16 at 20:38
• @TobiasKildetoft I edited in pictures of my work, is this correct? – Esoemah Mar 9 '16 at 22:26

## 2 Answers

$$\det A=3\neq27=\det B\implies A,\,B\;\;\text{cannot be similar}$$

• But they have the same eigenvalues. I don't really think this is a helpful answer. – Esoemah Mar 9 '16 at 21:10
• @Esoemah Even if that was true, and I'm not sure it is, similar matrices have the same trace and the same determinant. As these two don't they can't be similar. Check the determinants, perhaps I made I mistake, or perhaps you miscopied. For example, if that first entry in $\;B\;$ was $\;3\;$ and not $\;-3\;$ , as written there, then they'd have the same determinant. – DonAntonio Mar 9 '16 at 21:13
• I miscopied, the 2 should be a -2, and then the determinants are the same. I'm sorry about that. – Esoemah Mar 9 '16 at 21:17
• I edited in pictures of my work, is this correct? – Esoemah Mar 9 '16 at 22:27

If you have an eigenvalue of multplicity, you will get multiple eigenvalues associated with that eigenvalue.

$$\begin{bmatrix} 1 & 0 \\ 1 & -1\\ 2 & 0\\ \end{bmatrix}\begin{bmatrix} 0&-1 \\ 1&0\\ 0&1\\ \end{bmatrix} = \begin{bmatrix} 0&1 \\ -1&0\\ 0&-1\\ \end{bmatrix}= \begin{bmatrix}0&-1 \\ 1&0\\ 0&1\\ \end{bmatrix}(-I)$$

Find the 3rd eigenvetor and you will have

$$AP = P\begin{bmatrix} -1&\\&-1\\&&3\end{bmatrix}\\ P^{-1}AP = \begin{bmatrix} -1&\\&-1\\&&3\end{bmatrix}$$