Show that if A and B are square matrices such that AB = BA, then (A+B)2=A2+2AB+B2.
Since A and B are square matrices such that AB = BA,
∴ (A+B)2 = (A + B).(A + B)
=A2 + AB + BA + B2
=A2 + AB + AB + B2 [∵ AB = BA]
= A2+2AB+B2
Hence proved.