$ \int_{0}^1\frac{1+x^6}{1-x^2+x^4-x^6+x^8}dx$ How do we compute this integral ?
$$ \int_{0}^1\frac{1+x^6}{1-x^2+x^4-x^6+x^8}dx$$
I have tried partial fraction but it is quite hard to factorize the denominator. Any help is appreciated. 
 A: $$
\begin{align}
\int_0^1\frac{1+x^6}{1-x^2+x^4-x^6+x^8}\,\mathrm{d}x
&=\int_0^1\frac{(1+x^6)(1+x^2)}{1+x^{10}}\,\mathrm{d}x\tag{1a}\\
&=\int_1^\infty\frac{(1+x^6)(1+x^2)}{1+x^{10}}\,\mathrm{d}x\tag{1b}\\
&=\frac12\int_0^\infty\frac{(1+x^6)(1+x^2)}{1+x^{10}}\,\mathrm{d}x\tag{1c}
\end{align}
$$
Explanation:
$\mathrm{(1a)}$: multiply by $\frac{1+x^2}{1+x^2}$
$\mathrm{(1b)}$: substitute $x\mapsto1/x$ and simplify
$\mathrm{(1c)}$: average $\mathrm{(1a)}$ and $\mathrm{(1b)}$
Depending on the context of the question, there are a few ways to compute $\mathrm{(1c)}$.
One is to use this answer, which gets $\int_0^\infty\frac{x^n}{1+x^{10}}\,\mathrm{d}x=\frac\pi{10}\csc\!\left(\frac{(n+1)\pi}{10}\right)$ by contour integration:
$$
\begin{align}
\int_0^\infty\frac{(1+x^6)(1+x^2)}{1+x^{10}}\,\mathrm{d}x
&=\int_0^\infty\frac1{1+x^{10}}\,\mathrm{d}x
+\int_0^\infty\frac{x^2}{1+x^{10}}\,\mathrm{d}x\\
&+\int_0^\infty\frac{x^6}{1+x^{10}}\,\mathrm{d}x
+\int_0^\infty\frac{x^8}{1+x^{10}}\,\mathrm{d}x\\
&=\frac\pi{10}\left[\csc\left(\frac{\pi}{10}\right)
+\csc\left(\frac{3\pi}{10}\right)
+\csc\left(\frac{7\pi}{10}\right)
+\csc\left(\frac{9\pi}{10}\right)\right]\\
&=\frac\pi5\left[\csc\left(\frac{\pi}{10}\right)+\csc\left(\frac{3\pi}{10}\right)\right]\\
&=\frac{2\pi}{\sqrt5}\tag{2}
\end{align}
$$
Therefore,
$$
\int_0^1\frac{1+x^6}{1-x^2+x^4-x^6+x^8}\,\mathrm{d}x=\frac\pi{\sqrt5}\tag{3}
$$
A: Let $I$ be the integral given by 
$$I= \int_{0}^1\frac{1+x^6}{1-x^2+x^4-x^6+x^8}dx$$
Now, make the substitution $x=u^{-1}$. Then $dx=-u^{-2}du$ and the limits of integration over $u$ extend from $\infty$ to $1$.  Thus, we may write
$$
\begin{align}
I & = \int_{\infty}^1 \frac{1+u^{-6}}{1-u^{-2}+u^{-4}-u^{-6}+u^{-8}}\left(-u^{-2}\right)du \\
& = \int_1^{\infty} \frac{1+u^{6}}{1-u^{2}+u^{4}-u^{6}+u^{8}}du 
\end{align}
$$
whereby 
$$I=\frac12 \int_0^{\infty} \frac{1+u^{6}}{1-u^{2}+u^{4}-u^{6}+u^{8}}du$$
Next, we exploit the even symmetry of the integrand, which reveals that 
$$I=\frac14 \int_{-\infty}^{\infty} \frac{1+u^{6}}{1-u^{2}+u^{4}-u^{6}+u^{8}}du$$
Using the Residue Theorem along with Jordan's Lemma, the integral $I$ is given by
$$I=2\pi i \left(\frac14\right)\sum_{i=1}^4 Res_i \left(\frac{1+z^{6}}{1-z^{2}+z^{4}-z^{6}+z^{8}}\right)$$
where the summation is over the four residues of the integrand in the upper-half plane.  
All that remains is to find the four complex roots $z_i$ of the denominator that lie in the upper-half plane.  These are $z_1=e^{\frac{\pi}{10}}$, $z_2=e^{\frac{3\pi}{10}}$, $z_3=e^{\frac{7\pi}{10}}$, and $z_4=e^{\frac{9\pi}{10}}$.
To find the residue of $z_i$, take the limit
$$\lim_{z \to z_i} (z-z_i) \left(\frac{1+z^{6}}{1-z^{2}+z^{4}-z^{6}+z^{8}}\right)=\frac{1+z_i^{6}}{-2z_i+4z_i^{3}-6z_i^{5}+8z_i^{7}}$$
A: This is not a final answer but it is too long for a comment.
Beside the elegant solution given by Dr.MV using the residue theorem, there is something I found interesting in the problem. $$\frac{1+x^6}{1-x^2+x^4-x^6+x^8}=(1+x^2+x^6+x^8)\sum_{k=0}^{\infty}(-1)^k x^{10k}$$ So $$I=\int_{0}^1\frac{1+x^6}{1-x^2+x^4-x^6+x^8}\,dx=\sum_{k=0}^{\infty}\int_{0}^1 (-1)^k(1+x^2+x^6+x^8)x^{10k}\,dx$$ which leads to $$I=\sum_{k=0}^{\infty}(-1)^k \left(\frac{1}{10 k+1}+\frac{1}{10 k+3}+\frac{1}{10 k+7}+\frac{1}{10
   k+9}\right)$$ and $I$ has a very nice and simple expression.
