Characteristic polynomial of AB and BA. [duplicate]

$A, B$ are $n\times{n}$ matrices over the field F. Do $AB$ and $BA$ have the same characteristic polynomial? I have been able to prove that they have the same set of characteristic values. Also if any one the matrices $A$, $B$ are invertible, then $AB$, $BA$ are similar and they have the same characteristic polynomial. What if they are both non invertible? Do they have the same characteristic polynomial then?

• $AB$ may be zero matrix whereas $BA$ may not zero matrix. – neelkanth Jan 12 '17 at 8:21

The result is valid for all $A,B\in \mathbb{F}^{n\times n}$. Denote $$C=\begin{bmatrix}{\lambda I}&{A}\\{B}&{I}\end{bmatrix},\quad D=\begin{bmatrix}{-I}&{0}\\{B}&{-\lambda I}\end{bmatrix}.$$ Then, $$CD=\begin{bmatrix}{\lambda I}&{A}\\{B}&{I}\end{bmatrix}\begin{bmatrix}{-I}&{0}\\{B}&{-\lambda I}\end{bmatrix}=\begin{bmatrix}{-\lambda I+AB}&{-\lambda A}\\{0}&{-\lambda I}\end{bmatrix},$$ $$DC=\begin{bmatrix}{-I}&{0}\\{B}&{-\lambda I}\end{bmatrix}\begin{bmatrix}{\lambda I}&{A}\\{B}&{I}\end{bmatrix}=\begin{bmatrix}{-\lambda I}&{- A}\\{0}&{BA-\lambda I}\end{bmatrix}.$$ Using that $\det(CD)=\det(DC)$ we get: $$\det (AB-\lambda I)(-\lambda)^n=(-\lambda)^n\det(BA-\lambda I)\Rightarrow \det(AB-\lambda I)=\det(BA-\lambda I)$$