= Solution
Use the <Characteristic polynomials of AB and BA>, which also account for the zero <eigenvalue> and <algebraic multiplicities>. The block <determinant>
$$
\det\begin{pmatrix}I&tA\\-B&I\end{pmatrix}
$$
equals both $\det(I+tAB)$ and $\det(I+tBA)$, by taking the two <Schur complements>. For $\lambda\ne0$, set $t=-1/\lambda$ and multiply by $\lambda^n$ to obtain
$$
\boxed{\det(\lambda I-AB)=\det(\lambda I-BA).}
$$
Both sides are <polynomials>, so agreement away from zero proves equality there as well. Their roots, with multiplicity, are the same. The familiar eigenvector argument $ABv=\mu v\Rightarrow BA(Bv)=\mu Bv$ works directly only when $\mu\ne0$, because then $Bv\ne0$; it should not be used to discard the zero case.
Back to article page