Evaluate $\int_0^{\infty} \frac{\sqrt{x}}{(x+1)^2} {\rm d}x$ 
I am trying to evaluate 
  \begin{align}
\int_0^{\infty} \frac{\sqrt{x}}{(x+1)^2}{\rm d}x = \frac{\pi}{2}
\end{align} 
  (This comes from Mathematica)

First of all, I want to solve this problem with the Residue theorem. 
Assuming $\sqrt{z}$ be the principal branch, $ \operatorname{Res}[f;-1] = -\frac{i}{2}$.  But I am having trouble with integral range. 

If I neglect (this should be checked) the contribution from $C_R$ and $C_{\epsilon}$, then this gives $\int_{-\infty}^{\infty}$ and dividing half I can fit result but the integrand is not even function... 
 A: It helps to first write $y=\sqrt{x}$ so your integral is $\int_0^\infty\frac{2y^2}{(y^2+1)^2}dy=\int_{-\infty}^\infty\frac{y^2}{(y^2+1)^2}dy$. We can evaluate this integral over $\Bbb R$ with the residue theorem as$$2\pi i\lim_{y\to i}\frac{d}{dy}\frac{y^2}{(y+i)^2}=2\pi i\lim_{y\to i}\frac{2iy}{(y+i)^3}=\frac{2\pi i2i^2}{(2i)^3}=\frac{\pi}{2}.$$If you're unconfident with the residue theorem, it helps to double-check this with a real method, by setting $y=\tan t$ in the integral on $\Bbb R^+$. The integral is then$$\int_0^{\pi/2}2\sin^2tdt=\frac{\pi}{2}2\times\frac12=\frac{\pi}{2}.$$
A: Take as the branch cut of $z^{\frac{1}{2}}$ the positive real axis.  Then choose a keyhole contour consisting of a segment from $\epsilon$ to $R$ over the real axis, a circle of radius $R$ taken in the positive (counter-clockwise) direction, a segment from $R e^{2\pi i}$ to $\epsilon e^{2 \pi i}$ and a circle in the clockwise direction from $\epsilon e^{2\pi i}$ to $\epsilon$. 
So we can integrate over the closed contour which surrounds the double pole at $z=-1$:
$$2\pi i \,\textrm{Res}_{z=-1} f(z) = \oint f(z)\,dz = \sum_k \int_k f(z)\,dz=\int_{\gamma_1}\,dz + \int_{\gamma_R}\,dz +\int_{\gamma_2}\,dz +\int_{\gamma_\epsilon}\,dz $$
$$2\pi i \,\textrm{Res}_{z=-1} \left[\frac{x^{\frac{1}{2}}}{(x+1)^2}\right] = \int_0^\infty \frac{x^{\frac{1}{2}} dx}{(x+1)^2} + \int_0^{2\pi} \frac{R^\frac{1}{2}e^{\frac{i\theta}{2}}Rie^{i\theta}\,d\theta}{(Re^{i\theta}+1)^2}-\int_\infty^0 \frac{e^{\pi i}x^{\frac{1}{2}} dx}{(x+1)^2}-\int_0^{2\pi} \frac{R^\frac{1}{2}e^{\frac{i\theta}{2}}Rie^{i\theta}\,d\theta}{(Re^{i\theta}+1)^2}$$
It is very easy to show that $$\int_{\gamma_R}\,dz \rightarrow 0 \,\,\,\textrm{ and }\int_{\gamma_\epsilon}\,dz \rightarrow 0$$ as both $R\rightarrow \infty$ and $\epsilon\rightarrow 0.$ 
You have already computed the residue to be $\frac{i}{2}.$
Thus $$2\pi i \cdot \left(-\frac{i}{2} \right)= \int_{\gamma_1}\,dz +\int_{\gamma_2}\,dz $$
so that
$$\pi = 2\int_0^\infty \frac{x^{\frac{1}{2}} dx}{(x+1)^2}  $$
or
$$\frac{\pi}{2} = \int_0^\infty \frac{x^{\frac{1}{2}} dx}{(x+1)^2}  $$
