Show that $\int_0^1 \! \frac{1+x^2}{1+x^4} \, \operatorname d \!x=1+\frac{1}{3}-\frac{1}{5}-\frac{1}{7}+\frac{1}{9}+\cdots$ As the title states, trying to solve $$\int_0^1 \! \frac{1+x^2}{1+x^4} \, \operatorname d \!x=1+\frac{1}{3}-\frac{1}{5}-\frac{1}{7}+\frac{1}{9}+\cdots$$
 A: Simply express the integrand as the series that converges for $|x| < 1$ and then interchange the order of summation and integration.
Hint: It is straightforward to show that
$$\frac{1 + x^2}{1 + x^4} = 1 + x^2 - x^4 - x^6 + x^8 + x^{10} - \cdots$$
because
$$\frac{1 + x^2}{1 + x^4} = \frac{1}{1 + x^4} + \frac{x^2}{1 + x^4}.$$
Hopefully you know what the geometric series are. Now integrate the series above term-by-term.
A: Hints: Expand the denominator as a geometric series in $-x^4$:
$$\frac{1}{1+x^4}=\sum_{n=0}^{\infty}(-1)^nx^{4n}=1-x^4+x^8-x^{12}+...$$
Multiply by $1+x^2$ to obtain a series form for the integrand.
$$\frac{1+x^2}{1+x^4}=\frac{1}{1+x^4}+\frac{x^2}{1+x^4}=1+x^2-x^4-x^6+x^8+x^{10}-x^{12}-x^{14}+...$$
All that's left is to integrate term-by-term.
A: $$\begin{align}
\int_0^1 \frac{1+x^2}{1+x^4} \operatorname d \!x &= 
\int_0^1  \frac{1+x^4-x^4+x^2}{1+x^4} \operatorname d \!x\\
&= 1 + \int_0^1 x^2\frac{1-x^2}{1+x^4} \operatorname d \!x\\
&= 1 + \int_0^1 x^2\frac{1 + x^4 - x^4-x^2}{1+x^4} \operatorname d \!x\\
&= 1 + \frac{1}{3} -\int_0^1 x^4\frac{1+x^2}{1+x^4} \operatorname d \!x\ \ldots
\end{align}
$$
and so forth.
