Contour integration. I would appreciate some assistance with the following integration:
$$\int_0^\infty\frac{x^a}{(x+1)^2}dx$$ where $-1<a<1$
along the contour avoiding branch point (at $x=0$) and pole (at $x=-1$) with the positive x-axis being a cut line, hence: from $x=\epsilon$ to $x=+R$ (=$I_1$), then from $x=+R$ to $x=-R$ (=$I_2$), then from $x=-R$ to $x=-1-\epsilon$ (=$I_3$), then around $x=-1$ ($=I_4$), then from $x=-1-\epsilon$ to $x=-R$ (=$I_5$), then from $x=-R$ to $x=+R$ (=$I_6$), then from $x=+R$ to $x=\epsilon$ (=$I_7$), and finally around $x=0$ (=$I_8$).
I understand that the two infinitesimal integrals, namely $I_4$ and $I_8$, will yield zero. I also understand that $I_1$ and $I_7$ are the desired integral and $-e^{2\pi ia}$ times the desired integral respectively. Moreover, $I_2$ and $I_6$ will likewise yield zero. However, I am not sure how to handle $I_3$ and $I_5$. Could anyone kindly advise?
 A: The contour encloses no singularity, hence the integral over the contour will be $0$.
$I_2,\, I_6$ and $I_8$ vanish in the limit. $I_3$ and $I_5$ cancel in the limit, because with the branch cut of $z^a$ along the positive real axis, the values along both integrals are the same, and the direction is opposite. $I_4$, however, does not vanish in the limit, but
$$\lim_{\rho\to 0} I_4(\rho) = -2\pi i \operatorname{Res} \left(\frac{z^a}{(z+1)^2};\,-1\right).$$
As $I_3$ and $I_5$ cancel, the contour is a needless complication, the standard keyhole contour is much simpler.
A: This integral may be evaluated using a keyhole contour that has four components.  Consider
$$\oint_C dz \frac{z^a}{(z+1)^2}$$
where $C$ is a keyhole contour of radius $R$ about the positive real axis, which is equal to
$$\int_0^R dx \frac{x^a}{(x+1)^2} + i R \int_0^{2 \pi} d\theta \, e^{i \theta} \frac{R^a e^{i a \theta}}{(1+R e^{i \theta})^2} \\ + e^{i 2 \pi a} \int_R^0 dx \frac{x^a}{(x+1)^2} + i \epsilon \int_{2 \pi}^0 d\phi \, e^{i \phi} \frac{\epsilon^a e^{i a \phi}}{(1+\epsilon e^{i \phi})^2}$$
As $R \to \infty$, the second integral vanishes because $a \lt 1$; as $\epsilon \to 0$, the fourth integral vanishes because $a \gt -1$.  Thus the contour integral is equal to
$$\left ( 1-e^{i 2 \pi a}\right ) \int_0^{\infty} dx \frac{x^a}{(1+x)^2}$$
By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the residue at the pole at $z=-1$.  This is a double pole, so the residue is equal to
$$\left [ \frac{d}{dz} z^a \right ]_{z=-1} = -a (-1)^a$$
It is important to note that by $-1$, we mean $e^{i \pi}$ as the branch is defined by $\arg{z^a} \in [0,2 \pi)$.  The integral is thus
$$\int_0^{\infty} dx \frac{x^a}{(1+x)^2} = \frac{-i 2 \pi a e^{i \pi a}}{1-e^{i 2 \pi a}} = \frac{\pi a}{\sin{\pi a}}$$
