TITLE: If $(A-B)^2=AB$, prove that $\det(AB-BA)=0$.
QUESTION [37 upvotes]: Let $A,B\in M_{n}(\mathbb{Q})$. If $(A-B)^2=AB$, prove that $\det(AB-BA)=0$.

I considered the function $f:\mathbb{Q}\rightarrow \mathbb{Q}$, $f(x)=\det(A^2+B^2-BA-xAB)$ and I obtained that:
$$f(0)=\det(A^2+B^2-BA)=\det(2AB)=2^n\det(AB)$$
$$f(1)=\det(A^2+B^2-BA-AB)=\det((A-B)^2)=\det(AB)$$
$$f(2)=\det(A^2+B^2-BA-2AB)=\det((A-B)^2-AB)=\det(AB-AB)=0$$
I don't have any other idea.

REPLY [5 votes]: In fact, there is a much stronger result.
Proposition. Let $a,b,c,d\in\mathbb{C}$. If $A,B\in M_n(\mathbb{C})$ satisfy  $aA^2+bB^2+cAB+dBA=0_n$, then, generically (for example, randomly choose $a,b,c,d$), $A,B$ are simultaneously triangularizable (for short, ST).
Proof. We follow the last part of the stewbasic's good post. We put $X=\alpha A+\beta B,Y=\gamma A+\delta B$; since generically $\alpha\delta\not= \beta\gamma$, it suffices to show that $X,Y$ are ST. 
We obtain (generically) $XY=kYX$ for some complex number $k$. Generically, $k\not=1$ and $k$ is not a primitive root of unity; then, by a result of Drazin, $X,Y$ are ST.
Remark 1. Of course, there are $a,b,c,d$ s.t. $A,B$ are not necessarily ST. For instance, consider $AB+BA=0_2$ with $A=\begin{pmatrix}1&0\\0&-1\end{pmatrix},\, B=\begin{pmatrix}0&1\\1&0\end{pmatrix}$.
Remark 2. That is linked to the concept of quasi-commutative matrices. There are two non-equivalent definitions:
i) $A,B$ are quasi-commutative iff $AB-BA$ commute with $A,B$. By a result from McCoy, $A,B$ are always ST.
ii) $A,B$ are quasi-commutative iff $AB=kBA$ where $k$ is a complex number. This is the definition we are interested in.