# Eigenvalues of $AB$ and $BA$ where $A$ and $B$ are square matrices

Show that if $$A,B \in M_{n \times n}(K)$$, where $$K=\mathbb{R}, \mathbb{C}$$, then the matrices $$AB$$ and $$BA$$ have same eigenvalues.

I do that like this:

let $$\lambda$$ be the eigenvalue of $$B$$ and $$v\neq 0$$

$$ABv=A\lambda v=\lambda Av=BAv$$

the third equation is valid, because $$Av$$ is the eigenvector of $$B$$. Am I doing it right?

• It looks correct and the right approach. – DonAntonio Jun 5 '14 at 16:43
• @DonAntonio The proof isn't correct. – user63181 Jun 5 '14 at 16:47
• I can't see any proof, leave alone it is correct or not, @user63181. Yet I can see now that I misread and the OP was attempting something that doesn't seem to help him to prove what he asked. – DonAntonio Jun 5 '14 at 16:49
• I think the OP was attempting the argument given here math.stackexchange.com/a/124903/49610 As for showing that $AB$ and $BA$ have the same characteristic polynomial, there's a beautiful, purely algebraic proof, in an answer I can't find for the life of me, using the fact that $$\begin{pmatrix}AB-t & 0 \\ 0 & -t\end{pmatrix}, \quad \begin{pmatrix}BA-t & 0 \\ 0 & -t \end{pmatrix}$$ can be cleverly factored as products of the same two matrices. – Branimir Ćaćić Jun 5 '14 at 17:17
• Also have a look at the following interesting blog post by Qiaochu Yuan:qchu.wordpress.com/2012/06/05/ab-ba-and-the-spectrum/… – user50948 Jun 5 '14 at 19:18

It suffices to show that $AB$ and $BA$ have the same characteristic polynomial. First assume that $A$ is invertible then

$$\chi_{AB}(x)=\det(AB-xI)=\det A\det(B-xA^{-1})\\=\det(B-xA^{-1})\det A=\det(BA-xI)=\chi_{BA}(x)$$ Now since $\operatorname{GL}_n(K)$ is dense in $\operatorname{M}_n(K)$ then there's a sequence of invertible matrices $(A_n)$ convergent to $A$ and by the continuity of the $\det$ function we have $$\chi_{AB}(x)=\det(AB-xI)=\lim_{n\to\infty}\det(A_nB-xI)=\lim_{n\to\infty}\det(BA_n-xI)\\=\det(BA-xI)=\chi_{BA}(x).$$

• While this proof works, I think there is a little bit too much machinery at play here, as the original problem is probably intended for a student who has just started learning about eigenvalues. – Christopher A. Wong Jun 5 '14 at 21:13

Here is a proof similar to what the OP has tried:

Let $\lambda$ be any eigenvalue of $AB$ with corresponding eigenvector $x$. Then

$$ABx = \lambda x \Rightarrow \\ BABx = B\lambda x \Rightarrow\\ BA(Bx) = \lambda (Bx)$$

which implies that $\lambda$ is an eigenvalue of $BA$ with a corresponding eigenvector $Bx$, provided $Bx$ is non-zero. If $Bx = 0$, then $ABx = 0$ implies that $\lambda = 0$.

Thus, $AB$ and $BA$ have the same non-zero eigenvalues.

• Can something similar be said about singular-values? Update: math.stackexchange.com/questions/2448088/… – LBogaardt Sep 27 '17 at 20:08
• Your proof has no interest because you don't show the equality of multiplicities of the eigenvalues of $AB,BA$. Moreover I don't see why the eigenvalue $0$ is a problem: if $\det(AB)=0$, then $\det(BA)=0$ too. – loup blanc Apr 13 '18 at 9:40
• @loupblanc My primary aim was to give a proof similar to the one OP attempted. About the zero eigenvalue problem, yes, if $A$ and $B$ are square matrices, that's true. But the proof I've shown is more general and works even if $A$ and $B$ are rectangular such that $AB$ and therefore $BA$ are square. – M. Vinay Apr 14 '18 at 11:57
• Remark that since the OP gave the green chevron to a complete solution, it's because he (she) understood that he was on a wrong path. Note also that to show the complete version of the result is natural because, generically, $AB$ and $BA$ are similar. The purpose of my post was not to annoy you but rather to point out that in the problems where this result is used, one always needs to consider the full spectrum (with multiplicity). Then, I propose that those who upvoted your post should not be allowed to use the considered result in its complete form. – loup blanc Apr 14 '18 at 13:01
• Let $A=\begin{bmatrix}0&1\\0&0\end{bmatrix}$, $B=\begin{bmatrix}0&0\\0&1\end{bmatrix}$. Then $AB = A \ne 0$, but $BA = 0$. So $AB$ and $BA$ are not always similar. Nevertheless, you are right that they will always have the same spectrum. I will attempt to update my answer with a proof of this (one that has not been given in any of the other answers). I think the best proof is Alternative proof #2 in math.stackexchange.com/a/822198/152030. – M. Vinay Apr 15 '18 at 4:07

Alternative proof #1:

If $n\times n$ matrices $X$ and $Y$ are such that $\mathrm{tr}(X^k)=\mathrm{tr}(Y^k)$ for $k=1,\ldots,n$, then $X$ and $Y$ have the same eigenvalues.

See, e.g., this question.

Using $\mathrm{tr}(UV)=\mathrm{tr}(VU)$, it is easy to see that $$\mathrm{tr}[(AB)^k]=\mathrm{tr}(\underbrace{ABAB\cdots AB}_{\text{k-times}}) =\mathrm{tr}(\underbrace{BABA\cdots BA}_{\text{k-times}})=\mathrm{tr}[(BA)^k].$$ Now use the above with $X=AB$ and $Y=BA$.

Alternative proof #2:

$$\begin{bmatrix} I & A \\ 0 & I \end{bmatrix}^{-1} \color{red}{\begin{bmatrix} AB & 0 \\ B & 0 \end{bmatrix}} \begin{bmatrix} I & A \\ 0 & I \end{bmatrix} = \color{blue}{\begin{bmatrix} 0 & 0 \\ B & BA \end{bmatrix}}.$$ Since the $\color{blue}{\text{red matrix}}$ and the $\color{red}{\text{blue matrix}}$ are similar, they have the same eigenvalues. Since both are block triangular, their eigenvalues are the eigenvalues of the diagonal blocks.

• Your second proof is very interesting, and it shows that for every commutative ring with identity $|Ex-AB|=|Ex-BA|$. But this proof is tricable and it is not clear how you guess for it. So I will be grateful if you give suggestive reasoning. – Mikhail Goltvanitsa May 19 '17 at 18:10
• @MikhailGoltvanitsa I think it is based on Schur Decomposition. A similar technique is used in this post. – MathGod Sep 22 '18 at 14:16
• @IshanSingh, Thank you very much! – Mikhail Goltvanitsa Sep 22 '18 at 18:17

If $A$ is invertible, user63181 already showed that

$$\det(AB-xI)=\det(BA-xI)$$

We now prove this equality in general.

Fix $x$

Let $$P_x(y):=\det[(A-yI)B-xI]-\det[B(A-yI)-xI] \,.$$

Then $P_x(y)$ is a polynomial of degree at most $n$ in $y$. Whenever $y$ is not an eigenvalue of $A$ the matrix $A-yI$ is invertible, thus by the first pat $P_x(y)=0$. Hence $P_x$ has infinitely many roots, and hence $P_x \equiv 0$.

This proves that $P_x(0)=0$ which is exactly what you need to prove.

• Very nice and algebraic solution! – Mikhail Goltvanitsa May 19 '17 at 18:01

Here is a more "algebraic" approach from the other answers by user63181 and N. S. which, as far as I can see generalizes to other fields (where the continuity argument might fail) although I thought the argument by continuity was cool!

First we use the following characterization of non-zero eigenvalues: $\lambda$ is an eigenvalue for $AB$ iff $I - \lambda AB$ is not invertible.

I claim the following: $I - \lambda AB$ is (not) invertible iff $I - \lambda BA$ is (not) invertible.

Proof: Suppose $I - \lambda AB$ is invertible, then let $U := 1 + \lambda B (I - \lambda AB)^{-1}A$. Now show that $U$ is an inverse to $I - \lambda BA$ (by multiplying out and using distributivity). The converse direction follows by letting $V := 1 + \lambda A(1-\lambda BA)^{-1}B$.

From this it follows that $AB$ and $BA$ have the same non-zero eigenvalues.

• Your proof has no interest because you don't show the equality of multiplicities of the eigenvalues of $AB,BA$. Moreover I don't see why the eigenvalue $0$ is a problem: if $\det(AB)=0$, then $\det(BA)=0$ too. – loup blanc Apr 13 '18 at 9:41