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.