# Show that, for square matrices $A$ and $B$, $A+B=AB$ implies $AB=BA$. [duplicate]

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.

## marked as duplicate by Bill Dubuque, user10354138, Cesareo, Xander Henderson, Ethan BolkerOct 21 '18 at 0:11

• I want to remark that, for a vector space $V$ over a field $K$ and for two $K$-linear operators $A,B: V\to V$ such that $A+B=A\circ B$, if $V$ is finite-dimensional over $K$, then $A$ and $B$ commute (i.e., $A\circ B=B\circ A$). However, the result does not hold if $V$ is infinite-dimensional over $K$. – Batominovski Oct 12 '18 at 16:44
• Take, for example, $V$ to be the vector space of infinite sequences $\mathbf{x}:=\left(x_i\right)_{i\in\mathbb{Z}_{>0}}$ of elements $x_1,x_2,x_3,\ldots\in K$. For each $\mathbf{x}:=\left(x_i\right)_{i\in\mathbb{Z}_{>0}}\in V$, define $$A(\mathbf{x}):=\left(x_1-x_2,x_2-x_3,x_3-x_4,x_4-x_5,x_5-x_6,\ldots\right)$$ and $$B(\mathbf{x}):=\left(x_1,x_2-x_1,x_3-x_2,x_4-x_3,x_5-x_4,\ldots\right)\,.$$ – Batominovski Oct 12 '18 at 16:45
• Then, for every $\mathbf{x}:=(x_i)_{i\in\mathbb{Z}_{>0}}$ in $V$, $$(A+B)(\mathbf{x})=\left(2x_1-x_2,2x_2-x_1-x_3,2x_3-x_2-x_4,\ldots\right)$$ and $$(A\circ B)(\mathbf{x})=A\left(x_1,x_2-x_1,x_3-x_2,\ldots\right)=\left(2x_1-x_2,2x_2-x_1-x_3,2x_3-x_2-x_4,\ldots\right)\,,$$ but $$(B\circ A)(\mathbf{x})=B\left(x_1-x_2,x_2-x_3,x_3-x_4,\ldots\right)=\left(x_1-x_2,2x_2-x_1-x_3,2x_3-x_2-x_4,\ldots\right)\,.$$ Thus, $$A+B=A\circ B\text{ but }A\circ B\neq B\circ A\,.$$ – Batominovski Oct 12 '18 at 16:45
$$A+B=AB$$ is equivalent to $$(I-A)(I-B)=I$$. As $$I-A$$ and $$I-B$$ are square, this implies $$(I-B)(I-A)=I$$, etc.