I want to evaluate the integral $\displaystyle \int_{0}^{\infty}\frac{\sqrt{x}}{1+x^2}\,dx$ using complex analysis methods. I know that I have to use a keyhole contour, but I don't know which function to integrate on the contour. For example if I had to integrate $\displaystyle \int_{0}^{\infty}\frac{\ln x}{1+x^2}\,dx$ then I would have chosen to integrate over a keyhole contour the function $\displaystyle f(z)=\frac{\ln^2 z}{1+z^2}\,dx$.
If i had known that function then the rest is routine, since if we declare the given integral as $I$ and the contour integral as $J$ , then there is a simple relationship of $I, \; J$. It holds that $J=2\pi i I $. Hence we have the result.
However, I did not understand well the keyhole contour. If someone could show me how the other parts disappear I would be glad.
Integrate $$ f(z) = \frac{\sqrt{z}}{1+z^2} $$ along the keyhole contour. Choose the "natural" branch of $\sqrt{z}$ (the branch cut along the positive real axis), i.e. $\sqrt{z} = re^{it/2}$, where $z = re^{it}$ with $0 < t < 2\pi$. That way the two integrals along the positive real axis won't cancel.