This is a brilliant proof by Fred. The key here is Cauchy integral theorem, where the integral on a closed contour is zero. The bloody book didn't say anything about this theorem at all.
By substituting z with (r,

) the second and fourth integrals can be derived more quickly, without the need for integration by parts.