prove that $\int_{-\infty}^{\infty} \frac{x^4}{1+x^8} dx= \frac{\pi}{\sqrt 2} \sin \frac{\pi}{8}$ 
prove that $$\int_{-\infty}^{\infty} \frac{x^4}{1+x^8} dx= \frac{\pi}{\sqrt 2} \sin \frac{\pi}{8}$$

My attempt:
C is semicircle in upper half complex plane
Simple poles = $e^{i\frac{\pi}{8}}, e^{i\frac{3\pi}{8}},e^{i\frac{5\pi}{8}},e^{i\frac{7\pi}{8}}$ lie in upper semi-circle C and real axis
Given integral value $= 2\pi i \cdot (\text{sum of residues}) = 2 \pi i \left(\frac{-1}{8}\right) \left[e^{i\frac{5\pi}{8}}+e^{i\frac{15\pi}{8}}+e^{i\frac{25\pi}{8}}+e^{i\frac{35\pi}{8}}\right] = 0.27059 \pi$
This is numerically equal to $\frac{\pi}{\sqrt 2} \sin \frac{\pi}{8}$. But without using calculator, how to get this expression.
 A: A couple of alternative approaches to Euler's Beta function or contour integration.
1) The reflection formula for the digamma function
By parity we have $I=\int_{-\infty}^{+\infty}\frac{x^4}{1+x^8}\,dx = 2\int_{0}^{+\infty}\frac{x^4}{1+x^8}\,dx $ and by splitting $\mathbb{R}^+$ as $(0,1]\cup(1,+\infty)$, then enforcing the substitution $x\mapsto \frac{1}{x}$ on the second interval,
$$ I = 2\int_{0}^{1}\frac{x^2+x^4}{1+x^8}\,dx = 2\sum_{n\geq 0}\left[\frac{1}{16n+3}+\frac{1}{16n+5}-\frac{1}{16n+11}-\frac{1}{16n+13}\right] $$
where the RHS is a sort of BBP-type formula. Since $\sum_{n\geq 0}\frac{1}{(n+a)(n+b)}=\frac{\psi(a)-\psi(b)}{a-b}$ and $\psi(x)-\psi(1-x)=-\pi\cot(\pi x)$,
$$ \sum_{n\geq 0}\left[\frac{1}{16n+3}-\frac{1}{16n+13}\right]=\frac{\pi}{16}\cot\frac{3\pi}{16},$$
$$ \sum_{n\geq 0}\left[\frac{1}{16n+5}-\frac{1}{16n+11}\right]=\frac{\pi}{16}\cot\frac{5\pi}{16},$$
and finally
$$ I = \frac{\pi}{8}\left[\cot\frac{3\pi}{16}+\cot\frac{5\pi}{16}\right] = \color{blue}{\frac{\pi}{\sqrt{2}}\sin\frac{\pi}{8}}=\frac{\pi}{2}\sqrt{1-\frac{1}{\sqrt{2}}}.$$
2) Glasser's Master Theorem
We have
$$ I = \int_{\mathbb{R}}\frac{dx}{x^4+\frac{1}{x^4}}=\int_{\mathbb{R}}\frac{dx}{\left(x^2+\frac{1}{x^2}\right)^2-2}=\int_{\mathbb{R}}\frac{dx}{\left[\left(x-\frac{1}{x}\right)^2+2\right]^2-2} $$
hence, by the residue theorem and de l'Hopital rule,
$$ I = \int_{\mathbb{R}}\frac{dz}{(z^2+2)^2-2}=2\pi i\sum_{\zeta\in Z}\operatorname*{Res}_{z=\zeta}\frac{1}{z^4+4z^2+2}\stackrel{\text{d.H.}}{=}\frac{\pi i}{2}\sum_{\zeta\in Z}\frac{1}{z^3+2z} $$
where $Z=\{i\sqrt{2-\sqrt{2}},i\sqrt{2+\sqrt{2}}\}$. Of course the outcome is the same.
A: Just extending what you've got so far. Let's note $z=e^{i\frac{5\pi}{8}}$ and recall that $\cos{z}=\frac{e^{iz}+e^{-iz}}{2}$, then:
$$2 \pi i \left(\frac{-1}{8}\right) \left[e^{i\frac{5\pi}{8}}+e^{i\frac{15\pi}{8}}+e^{i\frac{25\pi}{8}}+e^{i\frac{35\pi}{8}}\right]=
2 \pi i \left(\frac{-1}{8}\right) \left[z+z^3+z^5+z^7\right]=\\
2 \pi i \left(\frac{-1}{8}\right) z \left[1+z^2+z^4+z^6\right] = 
2 \pi i \left(\frac{-1}{8}\right) z \left[1+z^2+z^4(1+z^2)\right]=\\
2 \pi i \left(\frac{-1}{8}\right) z (1+z^2)(1+z^4)=
2 \pi i \left(\frac{-1}{8}\right) z^4 (z^{-1}+z)(z^{-2}+z^2)=\\
2 \pi i \left(\frac{-1}{8}\right) e^{i\frac{5\pi}{2}} 2\cos\left(\frac{5\pi}{8}\right)2 \cos\left(\frac{5\pi}{4}\right)=\pi i(-1)i \cos\left(\frac{\pi}{2}+\frac{\pi}{8}\right)\left(-\frac{1}{\sqrt{2}}\right)=\\
\frac{\pi}{\sqrt{2}}\sin\left(\frac{\pi}{8}\right)$$
A: $$\int_{-\infty}^{\infty} \frac{x^4}{1+x^8} dx=2\int_{0}^{\infty} \frac{x^4}{1+x^8} dx=2\int_{0}^{\infty} \frac{(x^8)^{1/2}}{1+x^8} dx\\
=\frac{1}{4} \int_{0}^{\infty} \frac{u^{5/8-1}}{(1+u)^{1}} du=\frac{1}{4}B\left(\frac{5}{8}, 1-\frac{5}{8}\right) =\frac{1}{4}\frac{\Gamma(5/8)\Gamma(1-5/8)}{\Gamma(1) }\\=\color{blue}{\frac{1}{4}\frac{π}{\sin(\frac{5π}{8}) }  =\frac{1}{4}\frac{π}{\sin(\frac{3π}{8}) }}\color{red}{=\frac{π}{\sqrt2}\sin(\frac{π}{8})}  $$ 
where we made use of the beta and Gamma function and the Schwartz duplication formula Along with the the below relations
$$-\frac{\sqrt2}{2}= \cos(\frac{3π}{4}) = \left(\cos^2(\frac{3π}{8})-\sin^2(\frac{3π}{8})\right)=\left(1-2\sin^2(\frac{3π}{8})\right) \\\implies\color{blue}{\sin (\frac{3π}{8}) =\frac{\sqrt{2+\sqrt2}}{2}} $$ 
And by the same token,
 $$\color{red}{\sin (\frac{π}{8}) =\frac{\sqrt{2-\sqrt2}}{2} = \frac{\sqrt{2}}{2\sqrt{2+\sqrt2}} =\frac{\sqrt{2}}{4\sin (\frac{3π}{8}) }.}$$
A: An alternative approach using complex analysis. 
It is not nice to have to calculate many residues. Just reduce it by noting the following:
\begin{align}
I=\int^{\infty}_{-\infty}\frac{x^4}{x^8+1}\,dx=\Re\left(2\int^\infty_{0}\frac{1}{x^4-i}\,dx\right)
\end{align}
Now calculate the RHS by considering:
\begin{align}
\oint_C\frac{1}{z^4-i}\,dz
\end{align}
Where $C$ is a quarter circle  with radius $R>1$ in the first quadrant. There is only one pole inclosed instead of four! Call that number $\alpha$. So you only have to find 1 residue (one fourth of the original number!). By the residue theorem we have:
\begin{align}
\oint_C\frac{1}{z^4-i}\,dz=2\pi i \text{Res}_{z=\alpha}\frac{1}{z^4-i}
\end{align}
On the other hand we have:
\begin{align}
\oint_C\frac{1}{z^4-i}\,dz=-i\int^R_0\frac{1}{x^4-i}\,dx+\int^R_0 \frac{1}{x^4-i}\,dx+\int_{B_R}\frac{1}{z^4-i}\,dz
\end{align}
where $B_R$ is the circular part. After letting $R\to\infty$ you can verify that:
\begin{align}
(1-i)\int^{\infty}_0 \frac{1}{x^4-i}\,dx=2\pi i \text{Res}_{z=\alpha}\frac{1}{z^4-i}
\end{align}
Hence:

\begin{align}
I=\Re\left[4\pi \frac{i}{1-i}\text{Res}_{z=\alpha}\frac{1}{z^4-i} \right]
\end{align}

The calculation are left for you. 
