I am doing some exercises in complex integration. I am given the two functions:
$$\frac{\sqrt{x}}{x^2+4}$$
$$\frac{1}{\sqrt{x}(x^2+1)}$$
They must be integrated from $0$ to $+\infty$ with a complex integration. From the solution I find that the correct path of integration for the first function is:
while for the second is:
So in the first integration both poles of the function contribute to the integral, but in the second only the pole at $+i$ contributes. I am lost. The two functions seem similar, why this difference?
On a more general ground: are there criteria for picking the correct integration path?


