The integrals in the paper (Hawking radiation as tunneling) In the paper PRL 85(2000), 5042, "Hawking radiation as tunneling", by Parikh and Wilczek, https://arxiv.org/abs/hep-th/9907001, there are some integrals, such as Eqs.(6) and (8). They are like this:
$$I=-\,\mathrm{Im} \int_{0}^{\omega}\int_{r_{in}}^{r_{out}}\frac{dr \,d\omega'}{1-\sqrt{\frac{2(M-\omega')}{r}}}=4\pi\omega(M-\omega/2)$$
How do you calculate them? The authors say they can be calculated by contour integrals, but as far as I know, only improper real integrals can be calculated with the help of contour integral. What about the these real integrals in finite intervals?
 A: The answer by @aitfel is on the right track, and I considered editing it, but it's sufficiently messy that I thought it best to write a new answer.
You want to calculate the imaginary part of the following integral:
$$\mathrm{Im} \int_{r_\mathrm{in}}^{r_\mathrm{out}}\frac{d\omega'}{1-\sqrt{\frac{2(M-\omega')}{r}}}$$
At first glance, you might worry about this integral for two reasons.

*

*If all the quantities are real, you might wonder how it can have an imaginary part.

*If the point $r=2(M-\omega')$ is within the range of integration, the integral seems not to be defined because the integrand is singular.

The resolution of both of these questions is stated by the Sokhotski-Plemelj theorem, which says that for the purposes of integration, one may take $\mathrm{Im}(1/x) = \pm i\pi\delta(x)$.
In words, what this means is that, as you approach the singular point of the integrand, you detour around it on a semi-circle on the complex plane, coming back to the real line on the other side of the singular point. This semi-circle contributes $\pm i \pi$ to the integral, and is only present if the original range of integration would have covered the singular point, hence the delta function. This provides a consistent interpretation of what could have been meant by integrating over a function that has a singularity of this kind. The reason for the $\pm$ is that you have a choice of detouring above or below the singular point, and this would change the sign of the result. Thus any time you use this technique, you need to be clear to define which way you will go around the singularity. (You could also choose to loop multiple times around the singularity, so the general result is any odd multiple of $i\pi$. For simplicity, I didn't write this.) In any physical application, either it won't matter which way you detour in the final result, or there will be some physical reason why one choice is correct. In this paper, the authors give such a prescription. Specifically, they say that $\omega'\to\omega'-i\epsilon$ should be taken to be slightly in the lower half of the complex plane. We will see how this settles the issue of which way to define the imaginary part of the integral.
Now since the imaginary part will come only from the point $r=2(M-\omega')$, we can expand around there in terms of $x = r-2(M-\omega')\ll 1$ to get
$$ \mathrm{Im} \int_{r_\mathrm{in}}^{r_\mathrm{out}}\frac{d\omega'}{1-\sqrt{\frac{2(M-\omega')}{r}}}=
4(M-\omega')\,\mathrm{Im}\int_{0^-}^{0^+}  \frac{dx}{x-i\epsilon}.$$
In the last step, the authors' prescription $\omega'\to\omega'-i\epsilon$ implies that $x\to x-i\epsilon$. In this way of writing things, we see that the singular point is at $x=+i\epsilon$ so that as we integrate we pass slightly below the singularity. This is equivalent to saying we detour slightly into the lower half complex plane. This corresponds to choosing the positive sign for the imaginary part of the integral, because we are moving on a clockwise semi-circle.
We therefore get
$$ \mathrm{Im} \int_{r_\mathrm{in}}^{r_\mathrm{out}}\frac{d\omega'}{1-\sqrt{\frac{2(M-\omega')}{r}}}= +4\pi(M-\omega') .$$
It's now a simple matter to perform the integral over $\omega'$ to obtain $4\pi\omega(M-\omega/2)$. However, note the overall minus sign in the original expression. I didn't include that minus sign in the above explanation, so it seems the sign is coming out wrong. However, I also assumed ${r_\mathrm{in}}<{r_\mathrm{out}}$ so the the lower limit of the integral is indeed lower than the upper limit. If, however, as the authors state, ${r_\mathrm{in}}>{r_\mathrm{out}}$, then one gets an additional minus sign from flipping the range of integration and everything works out as hoped.
A: Evaluating this integral actually requires distribution function trick. Here how it goes: before that just a pointer the relation between $r_{in}$ and $r_{out}$ is still an issue with my calculation and the one mentioned in the paper.
$$\color{red}{Im}\int_{r_{in}}^{r_{out}}\frac{dr}{{1-\sqrt{\frac{2(M-\omega')}{r}}}}$$ We're interested only in imaginary part of this integral and the discussion about the identity $\frac{1}{x}=-i\pi\delta(x)$ will let you understand

*

*Why the above value is independent of $r_{in}$ and $r_{out}$ ?

*And what Wilczek meant by displacing the contour in lower plane ($\omega'\rightarrow\omega'-i\epsilon$)? Hint: this way the $\mathcal{P}$ part of identity mentioned in the linked answer can make sense.

Expanding $r$ about $2(M-\omega')$ we have $$\frac{1}{{1-\sqrt{\frac{2(M-\omega')}{2(M-\omega')+\epsilon}}}}$$
$$\frac{4(M-\omega')}{\epsilon}$$  Now the integral becomes $$Im\int_{r_{in}-2(M-\omega')}^{r_{out}-2(M-\omega')}\frac{4(M-\omega')}{\epsilon}d\epsilon$$
$$Im\bigg(\frac{1}{\epsilon}\bigg)=-i\pi\delta (\epsilon)$$
therefore the above integral is
$$-4\pi(M-\omega')$$
To get this value we have to take $r_{in}<2(M-\omega')$ and $r_{out}>2(M-\omega')$ otherwise the delta function will throw zero. And this makes sense considering the discussion in the paper.
The leftout integral $$\int_{0}^{\omega}-4\pi(M-\omega')(-d\omega')$$ now gives us the desired result.
Nowhere in my derivation was I needed the relation $r_{in}>r_{out}$ which is explicitly mentioned in the paper. Don't know where am I missing it in above calculation?
