Find $\int_0^\infty \frac{\sqrt{x}}{x^2+2x+5} \, dx$ I imagine I should use the residue theorem here, but I'm not sure how to begin.
The book states that the answer to this problem is $\dfrac{\pi}{2\sqrt{2}} \sqrt{\sqrt{5}-1}$
 A: Well, here's the general layout of what I would do:
$$f(z)=\frac{e^{\frac12\operatorname{Log}(z)}}{z^2+2z+5}\\\begin{align}\int_0^{+\infty}f(x)~\mathrm dx&=\Re\left[\int_{-\infty}^{+\infty}f(x)~\mathrm dx\right]\\&=\Re\left[\oint_Cf(z)~\mathrm dz\right]\\&=\Re[2\pi i\operatorname{Res}(f,-1+2i)]\end{align}$$
Where $\Re(x+iy)=x$ and $C$ is some common contour for integrals that go from $-\infty$ to $+\infty$.
A: It is unnecessary to use residue theory. Let $y=\sqrt{x}$, then the integral is transformed into an integral of a rational function $\int_0^\infty \frac{2y^2}{y^4+2y^2+5} \,dy$, which is handled by considering partial fraction.
A: Hint: Using the keyhole contour
$$
\gamma=[i\epsilon,R+i\epsilon]\cup Re^{i\left[\sin^{-1}(\epsilon/R),2\pi-\sin^{-1}(\epsilon/R)\right]}\cup[R-i\epsilon,-i\epsilon]\cup\epsilon e^{i[3\pi/2,\pi/2]}
$$
as $R\to\infty$ and $\epsilon\to0$, we have
$$
\begin{align}
\int_0^\infty\frac{x^{1/2}}{x^2+2x+5}\,\mathrm{d}x
&=\frac12\int_\gamma\frac{z^{1/2}}{z^2+2z+5}\,\mathrm{d}z
\end{align}
$$
where
$$
\frac1{z^2+2z+5}=\frac1{4i}\left(\frac1{z+1-2i}-\frac1{z+1+2i}\right)
$$
and using the branch of $\sqrt{z}$ that is continuous on the inside of $\gamma$, where it is $\sqrt{x}$ just above the positive real axis and $-\sqrt{x}$ just below, we get
$$
\sqrt{-1\pm2i}=\pm\sqrt{\frac{-1+\sqrt5}2}+i\,\sqrt{\frac{1+\sqrt5}2}
$$
