This is a direct application of the identity (X+Y)^2 - (X-Y)^2 = 4XY.
Here, X = a and Y = b.
So, (a + b)^2 - (a - b)^2 = 4ab.
Alternatively, expanding directly:
(a + b)^2 = a^2 + 2ab + b^2
(a - b)^2 = a^2 - 2ab + b^2
Subtracting the two: (a^2 + 2ab + b^2) - (a^2 - 2ab + b^2) = a^2 + 2ab + b^2 - a^2 + 2ab - b^2 = 4ab.