Show that if A and B are square matrices such that AB = BA, then (A + B)2 = A2 + 2AB + B2.