Let w and z be two complex numbers. So that means
w = a+bi
z = c+di
where a,b,c,d are real numbers and i = sqrt(-1)
---------------------------
When is w+z purely real? When there is no imaginary part at all. Adding w and z gives
w+z = (a+bi) + (c+di)
w+z = (a+c) + (bi+di)
w+z = (a+c) + (b+d)i
The imaginary part here is (b+d)i. If we set it equal to zero, then we get
(b+d)i = 0
b+d = 0
b = -d
So if b = -d, then w+z is purely real. For instance, if w = 2+3i and z = 7-3i then
w+z = (2+3i)+(7-3i) = (2+7)+(3-3)i = 9+0i = 9
The result 9 being purely real without any imaginary part.
--------------------------
When is w+z purely imaginary? We'll follow the same path of logic but instead of setting the imaginary part to zero, we do that to the real part
Again,
w+z = (a+bi) + (c+di)
w+z = (a+c) + (bi+di)
w+z = (a+c) + (b+d)i
Set the real part (a+c) equal to zero and solve for zero
(a+c) = 0
a+c = 0
a = -c
When a = -c, then the sum of the complex numbers is purely imaginary
Example:
w = 9+12i
z = -9-14i
w+z = (9+12i)+(-9-14i)
w+z = (9-9)+(12i-14i)
w+z = (9-9)+(12-14)i
w+z = (0)+(-2)i
w+z = -2i
which is purely imaginary (with no real parts)
--------------------------
Both cases are very similar: if the corresponding values are equal but opposite, then we have cancellations to go from complex to purely real or purely imaginary. Depending of course on which values you set opposite.
The exception is that if a = -c and b = -d together, then w+z = 0 is purely real