# Let $A, B$ be square matrices of equal size ($n \times n$) and $A^2 + B =A^2B$. Prove that $AB=BA$

I need help with solving the problem about square matrices of equal size. I know that if $$A + B = AB$$, then $$AB = BA$$, but I can't prove this one. Please advise how to solve or think about this. Thanks in advance )

• Multiply on the left and right by A. Why is that allowed? – Paul Feb 10 '20 at 10:47
• Sorry for uncertainty, A and B both have size $n*$n – Tigran Petrosyan Feb 10 '20 at 10:56

Your equality is equivalent to $$(I-A^2)(I-B)=I$$ so $$(I-B)= (I-A^2)^{-1}$$. It is enough to check that $$A$$ commutes with $$(I-B)$$. But since $$A$$ commutes with $$(I-A^2)$$, it will also commute with its inverse.
Left-inverses are right-inverses. In your original problem, $$(I-A)(I-B) = I - A - B + AB = I$$ and so $$(I-A)(I-B) = I = (I-B)(I-A)$$ giving the result.
In your next example $$I=(I-A^2)(I-B)=(I+A)(I-A)(I-B) \\ \text{and} \\ I = (I-B)(I-A^2)= (I-B)(I-A)(I+A)$$ This gives two expressions for $$(I+A)^{-1}$$ and the result follows.