# Matrices problem with determinant and rank

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.

• As it is stated the question is false. For a counterexample see here. Jan 12, 2021 at 22:25
• I suppose the OP wanted to write $(A-B)^2=AB$. This question is solved here. Jan 12, 2021 at 22:40

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:

Let $$A$$, $$B$$ be two $$n\times n$$ matrices with real elements. Prove that if $$A^2+B^2=AB$$, then $$\det(AB−BA)=0$$.
Here you take $$\epsilon$$ a non-real number, $$\epsilon^3=1$$, the root for the equation $$x^2+x+1=0$$.
Then you calculate $$(A+\epsilon B)(A+\epsilon^2 B)$$, apply the determinant, and then the conclusion is proved.

• For the second claim you probably want $n$ not divisible by $3$. Jan 12, 2021 at 21:32
• For $n=3$ you can find a counterexample here: math.stackexchange.com/questions/1768707 Jan 12, 2021 at 22:14
• To conclude: the question is false and this answer as well. Jan 13, 2021 at 14:31