# Are the matrix products $AB$ and $BA$ similar?

Given two matrices $A,B.$ On what conditions does $AB \sim BA$ hold?

-
Since it certainly holds if $A$ and $B$ commute, it would be nice to see an example where $AB\ne BA$ yet $AB \sim BA$. – Greg Martin Jul 28 '12 at 0:01
Is is possible to prove that both share the same eigenvalues? – Tomer Galanti Jul 28 '12 at 0:03

If $A$ is invertible, then $AB = A(BA)A^{-1}$ which shows that $AB$ and $BA$ are similar. Similar (no pun intended) proof if $B$ is invertible.

-

$AB$ is conjugate to $BA$ if either $A$ or $B$ are invertible. If neither is the case, there are counterexamples: for example, it may be the case that $AB = 0$ while $BA \neq 0$. Explicitly, take $$A = \left[ \begin{array}{cc} 0 & 1 \\ 0 & 0 \end{array} \right], B = \left[ \begin{array}{cc} 0 & 0 \\ 0 & 1 \end{array} \right].$$

We have $AB = A$ but $BA = 0$.

However, there is a salvage: $AB$ and $BA$ have the same characteristic polynomial. See this blog post. (Short proof: this must hold if either $A$ or $B$ is invertible, and that condition is Zariski dense.)

-
Can you please provide with a reference regarding the case one of the matrices are invertiable ? – Belgi Jul 28 '12 at 0:51
@Belgi If $A$ is invertible, and if $C=A^{-1}$, then $C(AB)C^{-1}=BA$ as you can check. Similarly, if $B$ is invertible, and if $C=B^{-1}$, then $C(BA)C^{-1}=AB$. – Amitesh Datta Jul 28 '12 at 1:28

As mentioned already, if either of $A$ or $B$ is invertible (and both are the same size), we have \begin{align} AB=A(BA)A^{-1}\quad&\mbox{if A is invertible}\\ AB=B^{-1}(BA)B\quad&\mbox{if B is invertible} \end{align}

However, here is a short proof that even if $A$ is $m\times n$ and $B$ is $n\times m$, the characteristic polynomials of $AB$ and $BA$ differ only by a factor of $\lambda^{\large|n-m|}$.

-

The proof is rather straightforward and I do not assume anything about $A$ and $B$, except that they are square.

I do so by showing that they have the same eigenvalues. If that is the case then $A=MJM^{-1}$ and $B=CJC^{-1}$ both share the same $J$ in their Jordan form and I take for granted that there exist some matrix $K$ such that $C=KM$, in order to have $B=KMJ(KM)^{-1}$.

So suppose $\lambda$ is an eigenvalue of $AB$. Then $ABx=\lambda x$.

Premultiplying both sides by $B$, we get $BABx =BA(Bx) \lambda(Bx)$, which shows that $\lambda$ is also an eigenvalue of $BA$.

-
Having the same eigenvalues doesn't mean they share a Jordan form. You should read the other answers, the result is false if $A$ and $B$ are non-invertible. – EuYu Nov 26 '12 at 0:42
You're right, Ive just seen the counter example. I wrote it thinking they had a full set of eigenvalues, in which case that should be true of J. – Michael P. Nov 26 '12 at 0:55
Please note in my edit: the singular form of "matrices" is "matrix." – rschwieb Nov 26 '12 at 1:17