TITLE: How to integrate $\int_{0}^{2\pi} \frac{1}{\sin^4x + \cos^4 x} \,dx$
QUESTION [7 upvotes]: So I followed the explanations made in this post and I got that:
$$\int \frac{1}{\sin^4x + \cos^4 x} \,dx = \frac{\sqrt{2}}{2}\arctan\left(\frac{\sqrt{2}}{2}\tan\left(2x\right)\right) + C$$
But when I try to use the Leibniz-Newton formula and evaluate the integral from $0$ to $2\pi$ I get that it's $0$ because $\tan\left(2x\right)$ evaluates to $0$ at both $x=0$ and $x=2\pi$. Is there another way to solve this integral and get the correct answer ($2\pi\sqrt2$)?

REPLY [4 votes]: You've got many methods here to find the anti-derivative, but hey, why not one more?
Here 
\begin{align}
I &= \int \frac{1}{\sin^4(x) + \cos^4(x)}\:dx = \int \frac{1}{\cos^4(x)\left(\tan^4(x) + 1\right)}\:dx \nonumber \\
 &= \int \sec^2(x)\sec^2(x) \cdot\frac{1}{\tan^4(x) + 1}\:dx  = \int \sec^2(x) \cdot\frac{\tan^2(x) + 1}{\tan^4(x) + 1}\:dx 
\end{align}
Let $t = \tan(x)$:
\begin{align}
I &= \int \frac{t^2 + 1}{t^4 + 1}\:dt =  \int \frac{t^2 + 1}{\left(t^2 + \sqrt{2}t + 1\right)\left(t^2 - \sqrt{2}t + 1\right)}\:dt \nonumber \\
&= \int \frac{1}{2}\left[\frac{1}{t^2 + \sqrt{2}t + 1} + \frac{1}{t^2 - \sqrt{2}t + 1} \right]\:dt \nonumber \\
&= \frac{1}{2}\left[ \int \frac{1}{t^2 + \sqrt{2}t + 1}\:dt +  \int \frac{1}{t^2 - \sqrt{2}t + 1}\:dt \right] = \frac{1}{2}\left[ J_1 + J_2\right]
\end{align}
We now address $J_1$ and $J_2$ separately. Here we begin with $J_1$:
\begin{equation}
 J_1 = \int \frac{1}{t^2 + \sqrt{2}t + 1}\:dt = \int \frac{1}{\left(t + \frac{1}{\sqrt{2}}\right)^2 + \frac{1}{2}}\:dt = \frac{1}{\sqrt{\frac{1}{2}}}\arctan\left(\frac{t + \frac{1}{\sqrt{2}}}{\sqrt{\frac{1}{2}}}\right)= \sqrt{2}\arctan\left(\sqrt{2}t + 1\right)
\end{equation}
Note I've omitted the constant of integration here. Similarly we find that $J_2$ is
\begin{equation}
 J_2 = \sqrt{2}\arctan\left(\sqrt{2}t - 1\right)
\end{equation}
Thus our integral $I$ becomes:
\begin{align}
I &= \frac{1}{2}\left[ J_1 + J_2\right] = \frac{1}{2}\bigg[\sqrt{2}\arctan\left(\sqrt{2}t + 1\right) + \sqrt{2}\arctan\left(\sqrt{2}t - 1\right)\bigg] + C = \frac{1}{\sqrt{2}}\bigg[ \arctan\left(\sqrt{2}t + 1\right) + \arctan\left(\sqrt{2}t - 1\right)\bigg] + C \nonumber \\
&=\frac{1}{\sqrt{2}}\bigg[ \arctan\left(\sqrt{2}\tan(x) + 1\right) + \arctan\left(\sqrt{2}\tan(x) - 1\right)\bigg] + C
\end{align}
Where $C$ is the constant of integration. Thus, 
\begin{equation}
\int \frac{1}{\sin^4(x) + \cos^4(x)}\:dx =\frac{1}{\sqrt{2}}\bigg[ \arctan\left(\sqrt{2}\tan(x) + 1\right) + \arctan\left(\sqrt{2}\tan(x) - 1\right)\bigg] + C
\end{equation}