# If A and B are two Matrices , than find $(A-B)^2$.

IF $A$ and $B$ are two matrices, find $(A-B)^2$.

My first solution was : $$A^2 - 2AB + B^2.$$

My second solution was : $$(A-B)(A-B) \\ A^2 - AB - BA + A^2$$

Is one of them correct ? or both of them are incorrect ?

• Are you trying to find $(A + B)^2$ or $(A - B)^2$? You need to edit your post to make it clear. As it stands, both your answers are wrong if you are trying to find $(A + B)^2$ – user137481 May 11 '14 at 19:12

$A^2 - 2AB + B^2$ is not true for all matrices.
$A^2 - AB - BA + B^2$ is correct.
You need to know that $AB = BA$ in order to conclude that $(A-B)^2 = A^2 - 2AB + B^2$.
$(A-B)^2=(A-B)(A-B)=A(A-B)-B(A-B)=A^2-AB-BA+B^2$. In general $AB\not=BA$.
In general, the second solution is correct (with $B^2$ instead of $A^2$ at the end) but the first one is incorrect because matrix multiplication isn't commutative.