<s>[INST] Prove $\int_{0}^{\infty}\frac{2x}{x^8+2x^4+1}dx=\frac{\pi}{4}$ $$\int_{0}^{\infty}\frac{2x}{x^8+2x^4+1}dx=\frac{\pi}{4}$$
$u=x^4$ $\rightarrow$ $du=4x^3dx$
$x \rightarrow \infty$, $u\rightarrow \infty$
$x\rightarrow 0$, $u\rightarrow 0$
$$=\int_{0}^{\infty}\frac{2x}{u^2+2u+1}\cdot\frac{du}{4x^3}$$
$$=\frac{1}{2}\int_{0}^{\infty}\frac{1}{u^2+2u+1}\cdot\frac{du}{x^2}$$
$$=\frac{1}{2}\int_{0}^{\infty}\frac{1}{u^2+2u+1}\cdot\frac{du}
{\sqrt{u}}$$
Convert to partial fractions
$$\int_{0}^{\infty}\frac{1}{\sqrt{u}}-\frac{2}{u+1}+\frac{1}{(u+1)^2}du$$
$$=\left.2\sqrt{u}\right|_{0}^{\infty}-\left.2\ln(1+x)\right|_{0}^{\infty} -\left.\frac{1}{1+u}\right|_{0}^{\infty}$$
Where did I went wrong during my calculation?
 [/INST] Here  is an  approach  using  contour integration  in  case anyone  is
interested. Suppose we seek to verify that
$$\int_0^\infty \frac{2x}{x^8+2x^4+1} dx = \frac{\pi}{4}$$
or alternatively
$$\int_0^\infty \frac{x}{x^8+2x^4+1} dx = \frac{\pi}{8}.$$
We  use a  quarter pizza  slice contour  with the  straight components
$\Gamma_0$ and $\Gamma_1$  on the positive real axis  and the positive
imaginary axis and having radius $R$ ($\Gamma_2.$)
The denominator here is
$$(x^4+1)^2$$
so the poles are double and located at
$$\rho_{0,1,2,3} = \exp(\pi i/4 + 2\pi i k/4)
= \exp(\pi i/4 + \pi i k/2)$$
with $k = 0,1,2,3.$ Fortunately we can see by inspection that only the
first pole $\rho_0$ is inside the contour (argument is $\pi/4.$)
For the residue we get
$$\frac{1}{2\pi i}
\int_{|z-\rho_0|=\epsilon} \frac{z}{z^8+2z^4+1} \; dz.$$
Exploiting the symmetry put $w=z\exp(-\pi i/4)$ and $z=w\exp(\pi i/4)$
to get
$$\exp(\pi i/2) \frac{1}{2\pi i}
\int_{|w\exp(\pi i/4)-1|=\epsilon} 
\frac{w}{w^8-2w^4+1} \; dw
\\ =  \frac{i}{2\pi i}
\int_{|w-1|=\epsilon} 
\frac{w}{w^8-2w^4+1} \; dw.$$
The residue is thus given by
$$i\times \lim_{w\rightarrow 1}
\left(\frac{(w-1)^2 w}{w^8-2w^4+1}\right)'
= i\times \lim_{w\rightarrow 1}
\left(\frac{w}{(w+1)^2 (w^2+1)^2}\right)'
\\ = i\times \lim_{w\rightarrow 1}
\left(\frac{1}{(w+1)^2 (w^2+1)^2}
\\ - \frac{w}{(w+1)^4 (w^2+1)^4} 
(2(w+1)(w^2+1)^2+(w+1)^2 2(w^2+1) 2w\right).$$
This works out to
$$i \times \left(\frac{1}{16} - \frac{16+32}{256}\right)
= -\frac{i}{8}.$$
Returning to the main computation, on  the part of the contour that is
on the positive imaginary axis which is $\Gamma_1$ we obtain
$$\int_{\Gamma_1} \frac{z}{8z^8+2z^4+1} \; dz$$
which yields with $z=\exp(\pi i/2) x$
$$- \int_0^R \frac{\exp(\pi i/2) x}{8x^8+2x^4+1} 
\; \exp(\pi i/2) dx
= \int_{\Gamma_0} \frac{z}{8z^8+2z^4+1} \; dz.$$
Finally we have by the ML bound for the circular component
$$\lim_{R\rightarrow\infty} 
\left|\int_{\Gamma_2} \frac{z}{8z^8+2z^4+1} \; dz\right|
\le \lim_{R\rightarrow\infty} 2\pi R/4 \times 
\frac{R}{8R^8-2R^4+1} = 0.$$
It follows that 
$$\int_0^\infty \frac{x}{8x^8+2x^4+1} \; dx
= \frac{1}{2}\times 2\pi i \times -\frac{i}{8}
= \frac{\pi}{8}$$
which is the claim.
</s>