# Matrix Distributive Law

1. Apr 11, 2015

### pyroknife

1. The problem statement, all variables and given/known data
Not really a homework question. Something that I've been wondering about.

The distributive law holds for matrices. Let A and B be n x n matrices.
Why is the following true for all A&B?

$(A+B)^2=A^2+2AB+B^2$

I don't undrestand that middle term (2AB) and why there's a factor of 2 there, since matrices aren't always commutative (i.e., AB doesn't always equal BA).

Shouldn't it be $(A+B)^2=A^2+AB+BA+B^2$ instead?

2. Relevant equations

3. The attempt at a solution

2. Apr 11, 2015

### robphy

As you say, AB doesn't always equal BA.
So, as you say, $(A+B)^2=A^2+AB+BA+B^2$

But what you wrote isn't really the distributive law.
$C(A+B)=CA+CB$

3. Apr 11, 2015

### pyroknife

Yes, so it should be what you just stated right and not the first expression I had?

4. Apr 11, 2015

### Staff: Mentor

5. Apr 11, 2015

### pyroknife

It was from an example from a course I took. I did miss something however, the example had also stated that BA=0 in the problem statement....but that would still not yield the former equation. I do make mistakes sometimes when I copy down notes, so maybe I wrote the 2 in their by accident or my professor did....that would be my only explanation as the answer would be $A^2+AB+B^2$ if BA=0.