TITLE: How to show that $A^2=AB+BA$ implies $\det(AB-BA)=0$ for $3\times3$ matrices?
QUESTION [8 upvotes]: Let $A$ and $B$ be two $3\times 3$ matrices with complex entries such that $A^2=AB+BA$. Prove that $\det(AB-BA)=0$.

(Is the above result true for matrices with real entries?)

REPLY [13 votes]: Let $A,B\in F^{n,n}$, $F$ any field of characteristic $\ne 2$, $n$ odd. Assume they satisfy $A^2 = AB+BA$.
From $A^2=AB+BA$ it follows
$$
AB-BA= A^2-2BA= (A-2B)A.
$$
Then it holds
$$
\det(AB-BA) = \det((A-2B)A) = \det(A(A-2B)).
$$
Now we have
$$
A(A-2B) = A^2-2AB = BA-AB.
$$
This proves
$$
\det(AB-BA) = \det(BA-AB) = \det( -(AB-BA)) = (-1)^n \det(AB-BA),
$$
and since $n$ is odd (and $1+1\ne0$), $\det(AB-BA)=0$ follows.

If the field has characteristic 2 then the result is true as well: In this case $AB-BA=AB+BA=A^2$. Suppose $A$ is invertible. Then the assumption $A^2=AB+BA$ implies $I_3=BA^{-1}+A^{-1}B$. The trace of the matrix on the left is $1$, the trace of the matrix on the right is $tr(BA^{-1}+A^{-1}B)=tr(BA^{-1})+tr(BA^{-1})=0$, contradiction. So $A$ cannot be invertible, and $\det(AB-BA)=\det(A^2)=0$.