I'm calculating the integral $$\int_0^\infty\frac{x^{p}}{1+x}\;\mathbb{d}x.$$
I'm doing it similarly to the answer in https://math.stackexchange.com/a/1754522/868416, (note that this question is slightly different, but the solution strategy is the same nonetheless), but I'm stuck on the part integrating over the horizontal segments.
If $\delta$ is the width of the 'corridor' and we let $\delta \rightarrow 0+$, then the integral over the horizontal segement in the upper half plane should tend to $$\int_{\epsilon}^R\frac{x^{p}}{1+x}\;\mathbb{d}x.$$ The integral in the bottom half plane will tend to $$-e^{2\pi i p}\int_{\epsilon}^R\frac{x^{p}}{1+x}\;\mathbb{d}x.$$
How does one prove this? I first tried writing $z$ as $x \pm i \delta$ respectively and then obtaining $$\frac{z^p}{1+z} = \frac{\exp(p \log |t\pm i \delta| + p i \arg(t\pm i \delta)}{1+\exp(\log |t\pm i \delta| + i \arg(t\pm i \delta)},$$ but I always get stuck.
I also want to comment that this way of proving these integrals seems a bit weird to me, be we were advised to do it this way, since apparently it is easiest...