How to integrate $\int_{0}^{2\pi} \frac{1}{\sin^4x + \cos^4 x} \,dx$

A correct antiderivative is

$$ \int\frac{1}{\sin^4 x+\cos^4 x}\, \mathrm{d}x = \frac{1}{\sqrt{2}}\arctan\left(\frac{1}{\sqrt{2}}\tan(2x)\right)+\mathsf{C}, $$

which is true on every interval $ \left(\frac{k\pi}{2}-\frac{\pi}{4}, \frac{k\pi}{2}+\frac{\pi}{4} \right) $ with $k \in \mathbb{Z}$. You may check the following plot for the comparison of both sides.

Comparison

This is not surprising, since $\tan(2x)$ has discontinuity at every point of the form $k\pi/2 + \pi/4$ for $k \in \mathbb{Z}$, which naturally restricts the region of validity of the above formula.

If you want to get an expression that is valid on a larger set, you must patch different antiderivatives (with different choices of 'constant of integration') to remove discontinuity. Alternatively, we can exploit the symmetry of the integrand to write

\begin{align*} \int_{0}^{2\pi} \frac{1}{\sin^4 x+\cos^4 x}\,\mathrm{d}x &= 8\int_{0}^{\frac{\pi}{4}} \frac{1}{\sin^4 x+\cos^4 x}\,\mathrm{d}x \\ &= 8 \lim_{a \to (\pi/4)^+} \int_{0}^{a} \frac{1}{\sin^4 x+\cos^4 x}\,\mathrm{d}x, \end{align*}

which then can be computed by the above antiderivative.


Just an alternate method of evaluation that relies heavily on symmetry.

$$J=\int_0^{2\pi}\frac{dx}{\sin(x)^4+\cos(x)^4}$$ We can do a bunch of trig and notice that this simplifies to $$J=4\int_0^{2\pi}\frac{dx}{3+\cos(4x)}=16\int_0^{\pi/2}\frac{dx}{3+\cos(4x)}.$$ Preforming $4x\mapsto x$ gives $$J=4\int_0^{2\pi}\frac{dx}{3+\cos x}=8\int_0^\pi \frac{dx}{3+\cos x}.$$ Then we use my favorite substitution, $t=\tan(x/2)$: $$J=16\int_0^\infty \frac{1}{3+\frac{1-t^2}{1+t^2}}\frac{dt}{1+t^2}=8\int_0^\infty\frac{dx}{t^2+2}$$ and the rest is rather easy.


You cannot directly use the indefinite integral to compute the definite integral because $\tan 2\, x$ is not defined at $\pi/4, 3\pi /4, 5\pi /4, 7\pi /4$. But you can use the indefinite integral to compute the definite integral from $0$ to $\pi/4 -\epsilon$ , the integral from $\pi/4+\epsilon$ to $3\pi/4 -\epsilon$ etc. When you take the limit as $\epsilon \to 0$ pay attention to the sign of $\tan $ and $\arctan$. You should now be able to compute the integral.

Note. I have edited the answer based on the comment by Travis.