If A and B are square matrices of the same order such that AB = BA, then show that
Question:

If $A$ and $B$ are square matrices of the same order such that $A B=B A$, then show that $(A+B)^{2}=A^{2}+2 A B+B^{2}$.

Solution:

$(A+B)^{2}=(A+B)(A+B)$

$=A^{2}+A B+B A+B^{2}$

$=A^{2}+2 A B+B^{2}$  $(\because A B=B A)$

Hence, $(A+B)^{2}=A^{2}+2 A B+B^{2}$.