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 ?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityIF $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 ?
$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.