<s>[INST] Compute $\int_0^{2\pi} \frac 1{\sin^4x+\cos^4x}dx$ 
Evaluate $\int_0^{2\pi} \frac 1{\sin^4x+\cos^4x}dx$

My attempt:
$I=\int_0^{2\pi}\frac 1{\sin^4x+\cos^4x}dx=\int_0^{2\pi}\frac 1{(\sin^2x+\cos^2x)^2-2\sin^2(2x)}dx=\int_0^{2\pi}\frac {1}{1-2\sin^2(2x)}dx=\frac 12\int_0^{4\pi}\frac 1{1-2\sin^2(x)}dx=\frac 12 \int_0^{4\pi}\frac {1}{\cos(\frac{x}2)}dx=\int_0^{2\pi}\frac 1{\cos x}dx=0$
So it actually is:
$$I=2\int_0^{2\pi}\frac {1}{2-\sin^2(2x)}dx=\int_0^{4\pi}\frac{1}{2-\sin^2(x)}dx=\int_0^{4\pi}\frac 1{1+\cos^2x}dx$$
Now if I try to make the substituion $u=\tan(\frac x2)$ I get integral from $0$ to $0$...Why?
What I am doing wrong?
 [/INST] $\newcommand{\Re}{\operatorname{Re}}\newcommand{\Im}{\operatorname{Im}}$The integrand is periodic with period $\frac \pi 2$ hence:
\begin{align}
I:=\int^{2\pi}_0 \frac{1}{\sin^4 (x)+\cos^4(x)}\,dx = 4 \int^{\pi/2}_0 \frac{1}{\sin^4(x)+\cos^4(x)}\,dx
\end{align}
Applying Weierstrass substitution now leads to high order polynomial in the denominator, you can reduce the powers by noticing that:
\begin{align}
I &= 4\int^{\pi/2}_0 \Re\frac{1}{\sin^2(x)+i\cos^2(x)}-\Im \frac{1}{\sin^2(x)+i\cos^2(x)} \,dx \\
&= 4(\Re J- \Im J)
\end{align}
where $$J:= \int^{\pi/2}_0 \frac{1}{\sin^2(x)+i\cos^2(x)} \,dx$$ now we set $t=\tan(x)$ to get $$J = \int^\infty_0 \frac{1}{t^2+i}\,dt = \frac 1 2 \int^\infty_{-\infty}\frac{1}{t^2+i}\,dt$$
This integral is just a standard application of the Residue Theorem: 
$$J=\frac  \pi 2 e^{-i\pi/4}$$
So:
$$I = 2\pi \left[\cos\left(-\frac \pi 4 \right) -\sin\left(-\frac \pi 4 \right)\right] = 2\sqrt[]{2}\ \pi  $$
</s>