# How to determine which of the following matrices are similar?

If we have the following three matrices: $$A=\begin{bmatrix} 7 &1 \\ -5 &3 \end{bmatrix},\;\; B=\begin{bmatrix} 5 &-1 \\ 1 &5 \end{bmatrix},\;\; C=\begin{bmatrix} 5 &1 \\ 1 &5 \end{bmatrix}.$$ What is the right procedure to determine if matrices are similar? I know that if the matrices are similar, then the matrices have the samen eigenvalues. Using the negative of this (determine the eigenvalues of each matrix, if they are not similar they cannot be similar), I got that only $A$ and $B$ potentially could be similar.

I also know that if the 2 matrices $A$ and $B$ are similar then $A=PBP^{−1}$ but I don't know how to work this out further.

So how do I show that matrices are similar, using $A=PBP^{-1}$ for example to show it for $A$ and $B$?

• Have you computed the eigenvalues of $A$ and $B$ ? – Dark Jun 23 '16 at 12:17
• Yes, these both are 5+2i and 5-2i. – Bas Schimmel Jun 23 '16 at 12:27

As similar matrices have similar determinants, matrix $C$ is not similar to $A$ or $B$ as $\det C = 24$ but $\det A = \det B = 26$.

Now we notice that $A$ and $B$ have the similar egeinvalues from characteristic equation $$\lambda^2 - 10\lambda + 26 = 0$$ which gives $$\lambda_{1,2} = 5 \pm i.$$ We may diagonilize bouth matrises $A$ and $B$ and get that $A = PDP^{-1}$ and $B = QDQ^{-1}$ where $$D = \begin{pmatrix} 5 - i & 0\\ 0 & 5 + i \end{pmatrix}.$$ Now one may see that matrix $T = QP^{-1}$ satisfies equation $B = TAT^{-1}$: $$T = \begin{pmatrix} -i & i \\ 1 & 1 \end{pmatrix} \begin{pmatrix} -\frac{5i}{2} & \frac{1}{2}-i \\ \frac{5i}{2} & \frac{1}{2}+i \end{pmatrix} = \begin{pmatrix} -5 & -2 \\ 0 & 1 \end{pmatrix},$$ $$T^{-1} = \frac{1}{5}\begin{pmatrix} -1 & -2 \\ 0 & 5 \end{pmatrix},$$ $$TAT^{-1} = \frac{1}{5}\begin{pmatrix} -5 & -2 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 7 & 1 \\ -5 & 3 \end{pmatrix}\begin{pmatrix} -1 & -2 \\ 0 & 5 \end{pmatrix} = \begin{pmatrix} 5 & -1 \\ 1 & 5 \end{pmatrix} = B.$$

• Shouldn't the characteristic equation for both a and B be λ2−10λ+26=0? – Bas Schimmel Jun 23 '16 at 12:56
• @BasSchimmel yes, exactly. I've edited it, thanks – Anton Grudkin Jun 23 '16 at 12:58
• On the other hand, if the question is just whether the matrices are similar, once you determine that they have the same distinct eigenvalues, then they're both diagonalizable to the same diagonal, so they're similar and there's no need to compute the matrix. – egreg Jun 23 '16 at 12:58
• @egreg The question is indeed to determine whether or not the matrices shown are similar to one another, so all I have to do essentially is show that the matrices A and B have the same distinct eigenvalues? Sorry for asking, because English is not my mother tongue, but what does distinct eigenvalues mean exactly? For example if I had 2 matrices A and B and it turns out both matrices have eigenvalues λ=4 and λ=6. Then they are similar? But when i have two matrices, C and D, and they both have the eigenvalues λ=8 (2x) then they are not similar? – Bas Schimmel Jun 23 '16 at 13:06
• @BasSchimmel This is a sufficient condition: a $2\times2$ matrix having two distinct eigenvalues is diagonalizable; since the two matrices have the same eigenvalues, they diagonalize to the same matrix, so they're similar. But this is far from being a necessary condition. – egreg Jun 23 '16 at 13:12

$A$ and $B$ cannot be similar to $C$, since $\det(A)=\det(B)=26\neq \det(C)=24$. On the other hand $A$ and $B$ are similar with $$P=\begin{pmatrix} 2 & 2 \cr 6 & 2 \end{pmatrix}.$$ Here we have $B=PAP^{-1}$. I do not need eigenvalues for this computation. I start with an invertible matrix $P=\begin{pmatrix} s_1 & s_3 \cr s_2 & s_4 \end{pmatrix}$ and then rewrite $BP=PA$ as $$2s_1 + s_2 - 5s_3=s_1 - 2s_3 + s_4= - s_1 + 2s_2 - 5s_4=s_2 - s_3 - 2s_4=0.$$ The determinant condition is $s_1s_4-s_2s_3\neq 0$. Then we can solve the linear equations and take one with nonzero determinant.

• $\det A = \det B = 26$ – Dark Jun 23 '16 at 12:22
• How did you find P, without the use of the eigenvalues? – Bas Schimmel Jun 23 '16 at 12:32
• Did you ask an oracle for finding $P$? ;-) – egreg Jun 23 '16 at 12:32
• What do you mean egreg? – Bas Schimmel Jun 23 '16 at 12:35
• @BasSchimmel The same as you: the matrix $P$ pops out from nothing. And this answer is pretty unhelpful besides showing that Dietrich has made the computations, but likes to show off. – egreg Jun 23 '16 at 12:53