This question already has an answer here:
Let $A$ and $B$ be two $n$-by-$n$ real matrices such that $A+B = AB$. How do I prove that $AB= BA$?
I have tried using the trace function on $A+B-AB$. But I could not get any Ideas. Kindly provide me with hints.