Problem: Calculate $$\int_0^\infty\frac{\sqrt{x}}{x^2+4}dx$$
I did some calculations but for some reason I end up with half of the value it's supposed to have. Maybe someone can find my error:
First I substitute $u:=\sqrt x$, this yields the integral $$I=\int_0^\infty\frac{u^2}{u^4+4}du=\frac{1}{2}\int_{\mathbb R}\frac{u^2}{u^4+4}du$$
Now I integrate the function $f(z)=\frac{z^2}{z^4+4}$ along the path $\gamma_1\circ\gamma_2$ where $$\gamma_1:\ [-R,R]\to\mathbb C,\ t\mapsto t$$ and $$\gamma_2: [0,\pi]\to\mathbb C,\ t\mapsto Re^{it}$$ For the integral along $\gamma_2$ I obtain via the standard estimation that $\int_{\gamma_2}f(z)dz\to 0$ as $R\to\infty$ so we have $$2I=\lim_{R\to\infty}\int_{\gamma_1}f(z)dz=\lim_{R\to\infty}\oint_{\gamma_1\circ\gamma_2}f(z)dz$$ The rest is just the residue theorem: $f$ has 4 poles of order 1 at $\pm1\pm i$ where only $\pm 1+i$ are in the half-circle created by $\gamma_1\circ\gamma_2$. I let wolfram alpha do the work and obtain $$Res(f,1+i)=\frac{1}{8}(1-i)$$ $$Res(f,-1+i)=\frac{1}{8}(-1-i)$$ so we have $$2I=2\pi i(Res(f,1+i)+Res(f,-1+i)=\frac{\pi}{2}$$ but if I type in the integral at the beginning it says $I=\frac{\pi}{2}$, so somewhere I must have lost a factor of 2 but I can't find it. Maybe this is a duplicate but I am really eager to find the mistake I did in these calculations.
Thanks!
If $x=u^2$, then $\mathrm dx=2u\,\mathrm du$. Here's the factor $2$ that you missed.