Definite integrals question $$\int^{\pi/2}_{0} \frac{1}{\sin^4x + \cos^4 x} \,dx$$
First I solve the indefinite integral $$\int \frac{1}{\sin^4x + \cos^4 x} \,dx=\frac{\sqrt2}{2}\arctan\Big(\frac{\tan2x}{\sqrt2}
\Big)+C$$ by the universal substitution $\tan2x=y$.
My question is: when I do this substitution should I bound x around $(-{\pi/4},{\pi/4})$ because arctan function is defined over $(-{\pi/2},{\pi/2})$?
And if I bound it like this how to solve the definite integral?
 A: Your antiderivative function $F(x)$ is discontinuous at $x = \tfrac{\pi}{4}$ in the interval $(0,\pi/2)$. So fundamental theorem of calculus has to be applied separately over $(0,\tfrac{\pi}{4})$ and $(\tfrac{\pi}{4}, \tfrac{\pi}{2})$.
$$\int^{\pi/2}_{0} \frac{1}{\sin^4x + \cos^4 x} \,dx = \int^{\pi/4}_{0} \frac{1}{\sin^4x + \cos^4 x} \,dx+ \int^{\pi/2}_{\pi/4} \frac{1}{\sin^4x + \cos^4 x} \,dx  \\
 = F(\tfrac{\pi}{4}^{-}) - F(0) + F(\tfrac{\pi}{2}) - F(\tfrac{\pi}{4}^+)$$
Here $F(\tfrac{\pi}{4}^{-})$ represents $\lim_{h\to 0^-} F(\tfrac{\pi}{4} +h)$ etc. This should give you answer as $\frac{\pi}{\sqrt 2}$.
Side Note:
Here it is easier to find antiderivative using $\tan^2 x = u.$
A: One way to address the original integral is to say that
$$\begin{align}\int_0^{\pi/2}\frac1{\sin^4x+\cos^4x}dx&=\int_0^{\pi/2}\frac1{\frac14(1-\cos2x)^2+\frac14(1+\cos2x)^2}dx\\
&=2\int_0^{\pi/2}\frac1{1+\cos^22x}dx=\int_0^{\pi}\frac1{1+\cos^2y}dy\\
&=\int_0^{\pi}\frac{dy}{\sin^2y+2\cos^2y}\end{align}$$
Now,
$$\int_0^{\pi}\frac{d\theta}{a^2\sin^2\theta+b^2\cos^2\theta}$$
Has been encountered many times on this forum. It's kind of the grapefruit integral in that just about any method we apply to it hits it out of the park. Here, let's do it by folding:
$$\begin{align}\int_0^{\pi}\frac{d\theta}{a^2\sin^2\theta+b^2\cos^2\theta}&=\frac12\int_0^{\pi}\frac{d\theta}{a^2\sin^2\theta+b^2\cos^2\theta}+\frac12\int_0^{\pi}\frac{d\theta}{a^2\cos^2\theta+b^2\sin^2\theta}\\
&=\frac12\int_0^{\pi}\frac{(a^2+b^2)d\theta}{a^2b^2\cos^4\theta+(a^4+b^4)\sin^2\theta\cos^2\theta+a^2b^2\sin^4\theta}\\
&=\frac12\int_0^{\pi}\frac{(a^2+b^2)d\theta}{\frac14a^2b^2(1+\cos2\theta)^2+\frac14(a^4+b^4)\sin^22\theta+\frac14a^2b^2(1-\cos2\theta)^2}\\
&=\frac12\int_0^{\pi}\frac{(a^2+b^2)d\theta}{\frac12a^2b^2(\cos^22\theta+\sin^22\theta)+\frac12a^2b^2\cos^22\theta+\frac14(a^4+b^4)\sin^22\theta}\\
&=\frac12\int_0^{\pi}\frac{2d\theta}{\frac12(a^2+b^2)\sin^22\theta+\frac{2a^2b^2}{a^2+b^2}\cos^22\theta}\\
&=\frac12\int_0^{2\pi}\frac{d\phi}{\frac12(a^2+b^2)\sin^2\phi+\frac{2a^2b^2}{a^2+b^2}\cos^2\phi}\\
&=\int_0^{\pi}\frac{d\phi}{\frac12(a^2+b^2)\sin^2\phi+\frac{2a^2b^2}{a^2+b^2}\cos^2\phi}\end{align}$$
So folding has transformed our original $F(a^2,b^2)$ to $F\left(\frac12(a^2+b^2),\frac2{\frac1{a^2}+\frac1{b^2}}\right)$. Since the limit of the arithmetic-harmonic mean is the geometric mean, it follows that
$$F(a^2,b^2)=F(ab,ab)=\int_0^{\pi}\frac{d\theta}{ab}=\frac{\pi}{ab}$$
In the instant case, $a=1$, $b=\sqrt2$, so
$$\int_0^{\pi/2}\frac1{\sin^4x+\cos^4x}dx=\frac{\pi}{\sqrt2}$$
A: By letting $x=\arctan t$ we have
$$ \mathcal{J}=\int_{0}^{\pi/2}\frac{dx}{\sin^4 x+\cos^4 x} = \int_{0}^{+\infty}\frac{1+t^2}{1+t^4}\,dt=2\int_{0}^{1}\frac{1+t^2}{1+t^4}\,dt\\=2\sum_{k\geq 0}\left[\frac{1}{8k+1}+\frac{1}{8k+3}-\frac{1}{8k+5}-\frac{1}{8k+7}\right]$$
and by the reflection formula for the $\psi=\frac{d}{dx}\log\Gamma$ function
$$ \sum_{k\geq 0}\left[\frac{1}{8k+1}-\frac{1}{8k+7}\right]=\frac{\pi}{8}\cot\left(\frac{\pi}{8}\right),\qquad \sum_{k\geq 0}\left[\frac{1}{8k+3}-\frac{1}{8k+5}\right]=\frac{\pi}{8}\cot\left(\frac{3\pi}{8}\right)$$
so the final outcome is simply $\mathcal{J}=\frac{\pi}{\sqrt{2}}$.
A: Since the other answers have already pointed out the problem with using a discontinuous antiderivative (see also this related question), let me supply an expression for an antiderivative that is continuous over the real line:
$$\int\frac{\mathrm dx}{\cos^4x+\sin^4x}=\sqrt{2}x-\frac1{\sqrt{2}}\arctan\left(\frac{\left(\sqrt{2}-2\right) \sin (4 x)}{\left(\sqrt{2}-2\right) \cos (4 x)-\sqrt{2}-2}\right)$$
You can verify this relation by differentiating the expression on the right. From here, you can then use the normal evaluation method:
$$\left.\sqrt{2}x-\frac1{\sqrt{2}}\arctan\left(\frac{\left(\sqrt{2}-2\right) \sin (4 x)}{\left(\sqrt{2}-2\right) \cos (4 x)-\sqrt{2}-2}\right)\right|_{x=0}^{x=\pi/2}=\frac{\pi}{\sqrt{2}}$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[10px,#ffd]{\ds{%
\int_{0}^{\pi/2}{\dd x \over \sin^{4}\pars{x} + \cos^{4}\pars{x}}}} =
\int_{0}^{\pi/2}{\sec^{2}\pars{x} \over \tan^{4}\pars{x} + 1}
\,\sec^{2}\pars{x}\,\dd x
\,\,\,\stackrel{\tan\pars{x}\ \mapsto\ x}{=}\,\,\, \int_{0}^{\infty}{x^{2} + 1 \over x^{4} + 1}\,\dd x
\\[5mm] & = \int_{0}^{\infty}{1 + x^{-2} \over x^{2} + x^{-2}}\,\dd x =
\int_{0}^{\infty}{1 + x^{-2} \over \pars{x - 1/x}^{2} + 2}\,\dd x
\,\,\,\stackrel{\pars{x - 1/x}\ \mapsto\ x}{=}\,\,\,
\int_{-\infty}^{\infty}{\dd x \over x^{2} + 2}
\\[5mm] & \stackrel{x/\root{2}\ \mapsto\ x}{=}\,\,\,
{1 \over \root{2}}\int_{-\infty}^{\infty}{\dd x \over x^{2} + 1} =
\bbx{{\root{2} \over 2}\,\pi} \approx 2.2214
\end{align}
A: It's best to continue your approach. The anti-derivative you have found is $$\frac{1}{\sqrt{2}}\arctan\left(\frac{\tan 2x} {\sqrt{2}}\right)$$ The integrand $f(x) $ satisfies the functional equation $f(\pi/2 - x) =f(x) $ and hence the integral reduces to $$2\int_{0}^{\pi/4}f(x)\,dx$$ and then using the anti-derivative mentioned above we get the answer as $\pi/\sqrt{2}$. That the anti-derivative is valid on the interval $[0,\pi/4)$ and not on $[0,\pi/4]$ is not a major concern because the integral is a proper Riemann integral and thus equal to the limit of integral over $[0,t]$ as $t\to(\pi/4)^{-}$.
