# For all square matrices A and B of the same size, it is true that (A+B)^2 = A^2 + 2AB + B^2

The below statement is a true/false exercise.

Statement: For all square matrices A and B of the same size, it is true that (A + B)2 = A^2 + 2AB + B^2.

My thought process: Since it is not a proof, I figure I can show by example and come to a valid conclusion based on such example.

My work:

Come up with a square matrix A and B let both be a 2 by 2 matrix(rows and cols must be same).

Matrix A:

A = \begin{array}{ccc} 3 & 5 \\ 4 & 6 \\ \end{array}

Matrix B:

B = \begin{array}{ccc} 5 & 8 \\ 9 & 4 \\ \end{array}

A + B = \begin{array}{ccc} 8 & 13 \\ 13 & 10 \\ \end{array}

(A + B)^2 = \begin{array}{ccc} 233 & 234 \\ 234 & 264 \\ \end{array}

(A)^2 = \begin{array}{ccc} 29 & 45 \\ 36 & 56 \\ \end{array}

(AB) = \begin{array}{ccc} 60 & 44 \\ 74 & 56 \\ \end{array}

2(AB) = \begin{array}{ccc} 120 & 88 \\ 234 & 112 \\ \end{array}

(B)^2 = \begin{array}{ccc} 97 & 72 \\ 81 & 88 \\ \end{array}

(A)^2 + 2AB + B^2 = \begin{array}{ccc} 246 & 205 \\ 265 & 256 \\ \end{array}

Based my above work, the answer is false.

Is there another way to approach the problem? It seems like a lot of work needed to be done for a true/false question which raised my suscipion about whether there is a better way to look at the problem.

-
First, since a counterexample is all what you need, you can choose simpler matrices. With a lot of $0$, for instance. – alex Mar 4 '14 at 22:01
It is well known that matrix multiplication is not commutative. – EricAm Mar 4 '14 at 22:01
Second, ask yourself: where does the rule $(a+b)^2=a^2+2ab+b^2$ about real numbers come from? – alex Mar 4 '14 at 22:03
@alex distrubutive law for addition. But the problem gives it in terms of matrices. I did not even realized there was a rule hidden in the problem until you ask the question. – Nicholas Mar 4 '14 at 22:15

A counterexample is all you need, so you're done. You probably could have picked a simpler counterexample, say with most entries of $A$ and $B$ being $0,$ but yours works just fine.

As an alternative, note that if $A$ and $B$ are square matrices of the same size, then $$(A+B)^2=A(A+B)+B(A+B)=A^2+AB+BA+B^2.$$ From this, it follows that $$(A+B)^2=A^2+2AB+B^2$$ if and only if $AB=BA.$ So, any two square matrices $A,B$ of the same size such that $AB\neq BA$ will yield a counterexample.

-
Holy cow! I never thought of it like that. By the way, how did you know right off the bat the distrubitive law of addition will work for square matrices if AB = BA? – Nicholas Mar 4 '14 at 22:33
@Nicholas because distributiveness works even when $AB\ne BA$ (it's not related) – ratchet freak Mar 4 '14 at 22:51
@ratchetfreak Oh okay. I thought there was a relationship to be drawn. – Nicholas Mar 4 '14 at 23:05
@Nicholas: It's worth noting that this problem demonstrates that commutativity of multiplication is necessary to conclude that $(a+b)^2=a^2+2ab+b^2,$ where $a,b\in\Bbb R.$ Distributivity isn't enough, as we see above. – Cameron Buie Mar 5 '14 at 4:50

\begin{align*} (A+B)^2 &= (A+B)(A+B) \\ &= AA+AB+BA+BB \\ &= A^2 + AB+BA+B^2.\end{align*}

Is it always true that $AB+BA = 2AB$?

-
Of course, you'd probably show the question false by using a counterexample... – apnorton Mar 4 '14 at 22:10
@Arkamis Based on my counterexample, it does not look to be always be true. – Nicholas Mar 4 '14 at 22:23