# Show that two matrices with the same eigenvalues are similar

First assume that $A$ and $B$ are $p \times p$ matrices and that $\lambda_1,\ldots , \lambda_p$ are distinct eigenvalues of $A$ and $B$. I want to show that $A$ and $B$ are similar.

Here is my approach: The goal is to show that there is a nonsingular $p \times p$ matrix $P$ such that $B = P^{-1}A P$. We know the following is satisfied for each eigenvalue $$A \textbf x_j = \lambda_j \textbf x _j \text { where } j = 1,\ldots,p$$ and $\textbf x_j$ are the eigenvectors. Since $A$ and $B$ share the same eigenvectors, $B$ must satisfy the following $$B \textbf x_j = \lambda_j \textbf x _j \text { where } j = 1,\ldots,p$$ Thus we have $$B \textbf x_j = A \textbf x_j$$ We can take the $\textbf x_j$ as the columns of the matrix $P$ and get $$BP=AP$$ we know that the columns of $P$ are linearly independent so the matrix must be non singular. Unfortunately this means that $$A=B$$ but this is not what we wanted to show. Am I on the right track? Is there an obvious mistake I am making?

• We know that $A$ and $B$ share the same eigenvalues, but not necessarily the same eigenvectors – tylerc0816 Nov 7 '13 at 23:28
• it would be if you can change the eigenvalues in the title to distinct eigenvalues to better reflect your question. – abel Feb 24 '15 at 12:58

The idea in your approach almost works. But you cannot assume that $A$ and $B$ have the same eigenvectors! So you will have $$Ax_j=\lambda_jx_j,\ \ \ By_j=\lambda_jy_j.$$ As $\lambda_1,\ldots,\lambda_p$ are distinct, $x_1,\ldots,x_p$ and $y_1,\ldots,y_p$ are each linearly independent, so they are bases. Let $P$ be the change of basis $x\to y$, i.e. $P$ is the matrix such that $Px_j=y_j$, $j=1,\ldots,n$. It is clearly nonsingular: if $P(c_1x_1+\cdots+c_px_p)=0$, then $$0=c_1P(x_1)+\cdots+c_pP(x_p)=c_1y_1+\cdots+c_py_p,$$ so $c_1=\cdots=c_p=0$. Now, for each $j$, $$PBy_j=\lambda_j Py_j=\lambda_jx_j=Ax_j=APy_j.$$ As the $y$ are a basis, we get that $PB=AP$, i.e. $PBP^{-1}=A$.

• Ok, that makes sense, though I think there is a misplaced equals sign when showing that $P$ is non singular – rioneye Nov 8 '13 at 0:07
• Corrected, thanks. – Martin Argerami Nov 8 '13 at 0:09
• The one step that is a bit confusing, is the last one. You say that $y$ are the basis, but why does that mean they drop out of the equality? – rioneye Nov 8 '13 at 0:13
• change of basis should be y to x – Prashant Dattatrey Mar 30 at 7:50
• Not sure what you mean. – Martin Argerami Mar 30 at 14:00

Another way to proceed is to note that there is an invertible $p \times p$ matrix $S$ such that $S^{-1}AS = {\rm diag}(\lambda_{1},\ldots,\lambda_{p})$ and there is an invertible $p \times p$ matrix $T$ such that $T^{-1}BT = {\rm diag}(\lambda_{1},\ldots,\lambda_{p}).$ Then $TS^{-1}AST^{-1} = B,$ and we can take $P = (ST^{-1}).$

Be careful! If A and B are $n\times n$ matrices having the same p distinct eigenvalues where $p<n$ this argument doesn't work. Because in this case the base change matrix P would be a $p\times p$ matrix and we cannot multiply an $n \times n$ matrix with a $p\times p$ matrix.

• – Shaun Feb 24 '15 at 12:24

Two matrices with same eigenvalues are similar if they are non-singular! If the matrices are singular they may or may not be similar!

eg: $$M_1= \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{bmatrix}$$ $$M_2= \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix}$$

here $M_1$ & $M_2$ have the same set of eigenvalues! but they are not similar.

• This is not correct mathematically. Suppose we take $M_1,M_2$, which have the same eigenvalues but are not similar (as you say), then add a positive multiple of the identity to make them both invertible, e.g. $M_1+I,M_2+I$ are both invertible and have the same "non-similarity" as your example. – hardmath Jun 15 '17 at 5:00
• Note that the Question postulates that $A,B$ are $p\times p$ matrices which share the same $p$ distinct eigenvalues. This is sufficient to guarantee $A,B$ are similar (since both are diagonalizable to the same diagonal matrix $D$). – hardmath Jun 15 '17 at 12:58