Minimal polynomials of AB and BA (source code)

= Minimal polynomials of AB and BA
{c}
{title2=$m_{AB},m_{BA}$}

For square matrices $A,B$,
$$
m_{BA}(t)\mid t,m_{AB}(t),
\qquad
m_{AB}(t)\mid t,m_{BA}(t).
$$
Indeed, $(BA)^{k+1}=B(AB)^kA$. Thus the two minimal polynomials have the same nonzero factors with the same multiplicities, while their powers of $t$ differ by at most one.