Consider the following integral: $$\int_{-\infty}^\infty \frac{pe^{ipr}}{\sqrt{p^2 + m^2}} dp$$ where $r, m$ are positive constants.
This integral appears in a quantum field theory textbook by Peskin & Schroeder. I know that this integral can be solved using a change of variables or Bessel functions (as described here: Peskin and Schroeder, Eq 2.52 with a spacelike interval.).
In the text they consider the integrand as a complex function, and thus because of the square root function there are branch points at $\pm im$. The two obvious choices for branch cuts here would be the line segment $(-im, im)$ on the imaginary axis or $(-i\infty, -im) \cup (im, i\infty)$ also through the imaginary axis. Since the original integral is over the real line only the second branch cut makes sense. I understand everything until this point. The authors then say
To evaluate the integral we push the contour up to wrap around the upper branch cut.
and make the substitution $\rho = -ip$ to obtain $$2\int_m^\infty \frac{\rho e^{-\rho r}}{\sqrt{\rho^2 - m^2}} d\rho.$$
Here is a figure of what they're doing.
I am very confused on what they're doing. The first path from $(-\infty, \infty)$ does not cross a pole or a branch cut so what is the need for this substitution? How do they get the extra factor of 2 after doing the transformation? How did the lower limit of integration go from $-\infty$ to $m$? The lower limit is obvious from the picture but this doesn't follow from the transformation they gave.
More importantly how is any of this justified? The first contour $(-\infty, \infty)$ is not closed so how can we transform it to the U shaped contour they describe and expect the two integrals to be the same?
