I'm trying to calculate the following integral using the residue theorem. $$ I=\int_{0}^{+\infty} d x \frac{\sqrt{x}}{\left(x^{2}+1\right)^{2}}=\frac{\pi}{4 \sqrt{2}} $$ But somehow I'm not getting the correct results, and I was hoping you could help spot where things go wrong? Because I have looked it through several times and can't seem to find anything wrong. Here is my approach:
Define: $$ f(z)=\frac{(z)^{1 / 2}}{\left(z^{2}+1\right)^{2}}=\frac{(z)^{1 / 2}}{(z+i)^{2}(z-i)^{2}} $$
f has poles of 2nd order at $z=\pm i$. And it has a branch point at $z=0$. Maintaining $f$ as a single-valued function is fairly easy, if I define $z=|z|e^{i\theta} $ and restrict $\theta\in[0,2\pi]$.
I want to integrate $f$ over the following contour:

$$ \oint f(z) d z=\int_{\Gamma^-} f(z) d z+\int_{c_{r}} f(z) d z+\int_{\Gamma^{+}} f(z) d z+\int_{C_{R}} f(z) d z=2 \pi i \operatorname{Res}(f, z=i) $$
The integral along the infinite halfcircle ($C_R$ where $R\rightarrow \infty$) converges to zero. The same goes for the infinitesimal circle $c_r$ as $r\rightarrow 0$.
The parametrization of $\Gamma^+$ gives the integral we are trying to solve: $$ \int_{\Gamma^{+}} f(z) d z=\int_{0}^{\infty} \frac{\sqrt{x}}{\left(x^{2}+1\right)^{2}} d x=I $$
If we want to parametrize $\Gamma^-$ we can set $z=xe^{i\pi}$ and $dz=-dx$ and integrate from $-\infty$ to $0$: $$ \int_{\Gamma^-} f(z) d z=\int_{-\infty}^{0} \frac{x^{1 / 2} e^{i \pi / 2}}{\left(x^{2} e^{2 i \pi}+1\right)^{2}}(-d x) $$ but substituting $x=-u$ and $dx=-du$, changing sign of limits and reversing the limits ends up being equivalent with $$ =\int_{0}^{\infty} \frac{\left(u\right)^{1 / 2}}{\left(u^{2}+1\right)^{2}} d u=I $$
Calculating the residue of the enclosed pole: $$ \operatorname{Res}(f, z=i)=\lim _{z \rightarrow i}\left[\frac{d}{d z}(z-i)^{2} f(z)\right]=\lim _{z \rightarrow i}\left[\frac{d}{d z} \frac{z^{1 / 2}}{(z+i)^{2}}\right]=\frac{e^{-i \pi / 4}}{8}=\frac{1}{8}\left(\frac{\sqrt{2}}{2}-\frac{\sqrt{2}}{2} i\right) $$
Which ends up giving: $$ \begin{aligned} &\Rightarrow \oint f(z) d z=2 I=2 \pi i \frac{1}{8}(1-i) \frac{\sqrt{2}}{2} \\ &\Rightarrow I=\int_{0}^{\infty} \frac{\sqrt{x}}{\left(x^{2}+1\right)} d x=\frac{\pi}{8} \frac{\sqrt{2}}{2} i(1-i)=\frac{\pi}{8} \frac{\sqrt{2}}{2}(1+i) \end{aligned} $$ Which of course isn't quite right.
It is practical to perform the substitution $x\mapsto z^2$ in order to get, by parity
$$ I = \int_{-\infty}^{+\infty}\frac{z^2}{(z^4+1)^2}\,dz. $$ It is also practical to perform a step of integration by parts, by reading the integrand function as $\frac{1}{4z}\cdot\frac{4z^3}{(z^4+1)^2}$ and by taking $\frac{1}{z^4+1}-1 = -\frac{z^4}{z^4+1}$ as a primitive of $\frac{4z^3}{(z^4+1)^2}$. The outcome is $$ I = \frac{1}{4}\int_{-\infty}^{+\infty}\frac{z^2}{z^4+1}\,dz=\frac{1}{4}\int_{-\infty}^{+\infty}\frac{dz}{\left(z-\frac{1}{z}\right)^2+2} $$ which by Glasser's master theorem equals $$ \frac{1}{4}\int_{\mathbb{R}}\frac{dt}{t^2+2} = \color{red}{\frac{\pi}{4\sqrt{2}}}.$$