How to integrate $\int_{0}^{2\pi} \frac{1}{\sin^4x + \cos^4 x} \,dx$ 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$)?

The given antiderivative, $$\frac{1}{\sqrt 2} \arctan \left( \frac{1}{\sqrt 2} \tan 2 x \right)$$ is not defined everywhere on the interval $[0, 2 \pi]$ of integration---it is undefined at $\frac{\pi}{4}, \frac{3 \pi}{4}, \frac{5 \pi}{4}, \frac{7 \pi}{4}$, so the usual hypotheses of the Fundamental Theorem of Calculus are not satisfied for that interval. In retrospect this is not surprising, since the trigonometric substitution that leads to this formula is not defined at those values.
On the other hand, using the double angle formulas for $\sin$ and $\cos$ (or just their complex representations) shows that the integrand has period $\frac{\pi}{2}$; using this observation and the symmetry of the integrand gives
$$\int_0^{2 \pi} \frac{dx}{\sin^4 x + \cos^4 x} = 8 \int_0^{\frac{\pi}{4}} \frac{dx}{\sin^4 x + \cos^4 x} .$$ The given antiderivative is defined everywhere on $[0, \frac{\pi}{4})$, so we can write
$$\int_0^{2 \pi} \frac{dx}{\sin^4 x + \cos^4 x} = 8 \cdot \lim_{a \nearrow \frac{\pi}{4}} \int_0^a \frac{dx}{\sin^4 x + \cos^4 x}$$
apply the F.T.C., and compute the limit.
Of course, since $\sin$ and $\cos$ do not vanish simultaneously, the original integrand is defined everywhere, and hence it has a continuous antiderivative on all of $\Bbb R$. One can verify that the antiderivative $F$ satisfying $F(0) = 0$ is
$$
F(x) =
\left\{
\begin{array}{cl}
\cdots & \cdots \\
\frac{1}{\sqrt 2} \arctan \left( \frac{1}{\sqrt 2} \tan 2 x \right), & -\frac{\pi}{4} < x < \frac{\pi}{4} \\
\frac{\pi}{2 \sqrt 2}, & x = \frac{\pi}{4} \\
\frac{1}{\sqrt 2} \left(\arctan \left( \frac{1}{\sqrt 2} \tan 2 x \right) + \pi \right) , & \frac{\pi}{2} < x < \frac{3 \pi}{4} \\
\frac{3 \pi}{2 \sqrt 2}, & x = \frac{3 \pi}{4} \\
\frac{1}{\sqrt 2} \left(\arctan \left( \frac{1}{\sqrt 2} \tan 2 x \right) + 2 \pi \right) , & \frac{3 \pi}{2} < x < \frac{5 \pi}{2}\\
\cdots & \cdots
\end{array}
\right. .
$$
It is evidently less practical than appealing to periodicity and symmetry as above, but we can also evaluate the integral by finding this antiderivative---which does satisfy the hypotheses of the F.T.C. on the interval $[0, 2 \pi]$---and then applying the F.T.C.
