Integral $\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\sin^2 x}{1+\sin^4 x}{\rm d}x$ Someone gives a solution as follows:
\begin{align*} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\sin^2 x}{1+\sin^4 x}{\rm d}x&=2\int_0^{\frac{\pi}{2}}\frac{\sin^2 x}{1+\sin^4 x}{\rm d}x\\ &=2\int_0^{\frac{\pi}{2}}\frac{\cos^2 x}{1+\cos^4 x}{\rm d}x\\ &=2\int_0^{\frac{\pi}{2}}\frac{\sec^2 x}{\sec^4 x+1}{\rm d}x\\ &=2\int_0^{\frac{\pi}{2}}\frac{{\rm d}(\tan x)}{(1+\tan^2 x)^2+1}\\ &=2\int_0^{+\infty} \frac{{\rm d}t}{(1+t^2)^2+1}\\ &\color{red}{=\frac{1}{2}\int_{-\infty}^{+\infty}\frac{{\rm d}u}{\left(u-\frac{1}{u\sqrt{2}}\right)^2+(1+\sqrt{2})}}\\ &=\frac{1}{2}\int_{-\infty}^{+\infty}\frac{{\rm d}u}{u^2+(1+\sqrt{2})}\\ &=\frac{\pi}{2} \sqrt{\sqrt{2}-1}  \end{align*}
I wonder how he obtains the sixth equality colored red.
 A: The red-colored line is obtained with the substitution $t = \frac1u$ as follows
\begin{align}
\int_0^{\infty} \frac{2}{(1+t^2)^2+1} dt
& =\int_{0} ^{\infty} \frac{2}{t^4+2t^2+2}dt\\
&=\int_{0}^{\infty} \frac{1}{\frac1{2u^2}+1+{u^2}} du\\
& =\frac{1}{2}\int_{-\infty}^{+\infty}\frac{1}{\left(u-\frac{1}{u\sqrt{2}}\right)^2+(1+\sqrt{2})}du
\end{align}
A: $$I=2\int_{0}^{\pi/2}\frac{\sin^2 x}{1+\sin^4 x} dx=2\int_{0}^{\pi/2} \frac{\tan^2 t \sec^2 x}{(1+\tan^2x)^2+\tan^4 x}dx=2\int_{0}^{\infty} \frac{t^2 dt}{2t^4+2t^2+1}$$
$$\implies I=2\int_{0}^{\infty} \frac{dt}{2t^2+1/t^2+2}=\frac{1}{\sqrt{2}}\int_{0}^{\infty}
\frac{(\sqrt{2}-1/t^2)+(\sqrt{2}+1/t^2)}{2t^2+1/t^2+2}dt$$
$$\implies I=\frac{1}{\sqrt{2}}\left( \int_{0}^{\infty} \frac{(\sqrt{2}-1/t^2)dt}{(t\sqrt{2}+1/t)^2-2(\sqrt{2}-1)}+\int_{0}^{\infty} \frac{(\sqrt{2}+1/t^2)dt}{(t\sqrt{2}-1/t)^2+2(\sqrt{2}+1)}\right)$$
Let the twin transformations $u=t\sqrt{2}+1/t$ and $v=t\sqrt{2}-1/t$ in the two integrals above, then
the first integral vanishes because both upper and lower limits become the same
$$I=\frac{2}{\sqrt{2}}\int_{0}^{\infty} \frac{du}{u^2+2(\sqrt{2}+1)}=\frac{\pi}{2\sqrt{(\sqrt{2}+1})}.$$
