Let us consider $A,B$ two $n \times n$ matrices with rational elements. Prove that if $(A+B)^2=AB$, then $\det(AB-BA)=0$.
My try: By the conclusion, I tried to prove that $\mathrm{rank}(AB-BA) \lt n$ and I thought about Sylvester's or Frobenius' inequalities. I can't go any further.
Let $a = \frac{3+\sqrt{5}}{2}$ and $b = \frac{3-\sqrt{5}}{2}$, $ab = 1$.
Then, $\det(A-aB) = c+d\sqrt{5} $ and $\det(A-bB) = c-d\sqrt{5}$.
So $\det(A-aB)\det(A-bB)$ is a rational number.
Thus, by calculating $(A-aB)(A-bB)$ and then applying the determinant, we obtain that $\det(AB-BA) = 0$.
This problem is similar to the following problem: