Klein-Gordon Propagator for spatial separation $x - y = (0, r)$ On pg. 27 of Peskin and Schroeder I would like to know how we get the first equality when deriving the Klein-Gordon propagator for $x^0 - y^0 = 0, \vec{x} - \vec{y} = \vec{r}$:
$$
D(x-y) = \int \frac{d^3p}{(2\pi)^3} \frac{1}{2E_p} e^{i \vec{p} \cdot \vec{r}} = \frac{2\pi}{(2\pi)^3} \int_{0}^{\infty} dp \frac{p^2}{2 E_p} \frac{e^{ipr} - e^{-ipr}}{ipr}
$$
The subsequent contour integral (2.52) makes sense but I'm a little confused about the derivation to get there from (2.50).
Why we are integrating only the imaginary part of $e^{ipr}$ and why the factor $ipr$ in the denominator?
 A: The easiest way to proceed is to notice that the first integral can only depend on $r := |\vec{r}|$. To convince yourself of this, you can rotate $\vec{r}$ by any rotation $R \in SO(3)$, and you notice that you can always "unwind" this rotation by a redefinition of the momentum variable being integrated (if you take $\vec{r}\to R\vec{r}$ then change variables to $R^{T} \vec{p} := \vec{p}'$, where the Jacobian is just $1$). Since this works for any $R$ you know this is only a function of $r$.
Because of this fact, you can make your life easier by picking $\vec{r} = ( 0, 0, r )$ (notice that $|( 0, 0, r )| = r$ is still true). If you plug this into the first integral you get
$$
\int \frac{d^3 \vec{p}}{(2\pi)^3 } \frac{1}{2 E_p} e^{- i \vec{p} \cdot \vec{r}} \ = \ \int \frac{d^3 \vec{p}}{(2\pi)^3 } \frac{1}{2 E_p} e^{- i p_3 r} 
$$
in spherical coordinates this becomes
$$
\cdots \ = \ \int \frac{dp \; d\theta \;  d\phi}{(2\pi)^3 } \frac{p^2 \sin\theta}{2 E_p} e^{- i r p \cos\theta }  \ .
$$
I leave it up to you to simplify this to your expression ($\phi$ integrates easily, and use the coordinate change $\mu = \cos\theta$).
