# Use of Cauchy's integral formula in the derivation of the Feynman propagator

In deriving the Feynman propagator in Timo Weigand's 2014 QFT2 notes, at the top of page 37, (equation 1.170), we use Cauchy's integral formula:

$$g(z_0)=\frac{1}{2\pi i}\oint_{C_1}\frac{g(z)}{z-z_0}\mathrm dz \tag{1.169},$$

to rewrite the equation 1.168 as a four-momentum integral:

$$\Theta(x^0-y^0)\frac{1}{2E_p}e^{-iE_p(x^0-y^0)}=-\Theta(x^0-y^0)\frac{1}{2\pi i}\oint_{C_1}\mathrm dp^0\frac{e^{-ip^0(x^0-y^0)}}{(p^0-E_p)(p^0+E_p)} \tag{1.170}.$$

In the above derivation the $$+E_p$$ is enclosed by the integral and the negative sign is due to the clockwise direction of the integral, we close the contour in the lower half of the $$\Bbb C$$-plane.

However, a straight application of equation 1.169 appears to give:

$$\Theta(x^0-y^0)\frac{1}{2E_p}e^{-iE_p(x^0-y^0)}=-\Theta(x^0-y^0)\frac{1}{2\pi i}\frac{1}{2}\oint_{C_1}\mathrm dp^0\frac{e^{-ip^0(x_0-y_0)}}{p^0(p^0-E_p)},$$

where have I gone wrong here?

Sidenote: I understand some people might believe this to be a mathematical question not a physics one, I am happy to move it if that's appropriate, but the language and notation is definitely physics and might be confusing.

(Here I use $$z$$ instead of $$p_0$$ for clarity). In your first equation, we take $$g(z) := \frac{e^{-iz(x_0-y_0)}}{z+E_p}$$
In particular, at $$E_p$$, $$g(z)$$ is equivalent to the advanced propagator: $$g(E_p) = \frac{e^{-iE_p(x_0-y_0)}}{2E_p}$$ In principle, you could take any function $$g(z)$$ such that $$g(E_p)$$ is the advanced propagator, but this choice is particularly nice since we end up with a manifestly Lorentz-invariant result.
Now invoke Cauchy's integral formula: $$g(E_p) = \frac1{2\pi i}\oint_C \frac{g(z)}{z-E_p} \mathrm{d}z \\ =\frac1{2\pi i}\oint_C \frac{e^{-iz(x_0-y_0)}}{(z+E_p)(z-E_p)} \mathrm{d}z$$