Integrating this complex function, using Residue Theorem I am having a massive amount of trouble integrating this, I really have no clue how to get the answer in the book:

$$\int_{-\infty}^{\infty} \frac{x^4}{1+x^8}dx$$

I know I need to find the poles on this function, which is basically the value of $x^8 = -1$ or I could split it up like the following:
$$x^8 +  1 = (x^4 + i)(x^4 - i)$$
With this I got the following poles (looking at $x^4 - i$), all have an order one:
\begin{array}
& x_1 = e^{\frac{i\pi}{8}} \\ x_2 = e^{\frac{3i\pi}{8}} \\ x_3 = e^{\frac{5i\pi}{8}} \\ x_4 = e^{\frac{7i\pi}{8}}
\end{array}
Now to calculate the residues I am trying to make use of the result that given a rational function $\frac{F}{G}$ such that both of them are analytic on a disk of radius $r$ with $G(z_0) = 0$ but $G'(z_0) \neq 0$ then we know that:
$$Res(\frac{F}{G};z_0) = \frac{F(z_0)}{G'(z_0)}$$
With that I am having difficulty getting results that are useful, I maybe calculating wrong and I am not sure but I have been spending a long time on this one question. The solution in the book is $\frac{\pi}{4}[sin(\frac{3\pi}{8}]^{-1}$. I would like a step by step solution to this or at least some guidance because I really need to learn this and I am not sure how to do this properly. Thank you!
 A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{\int_{-\infty}^{\infty}{x^{4} \over 1 + x^{8}}\,\dd x:\ {\large ?}.\quad}$
Let's take a 'pizza slice' with angle $\ds{{2\pi \over 8} = {\pi \over 4}\ \mbox{and}
\quad x_{1} = \expo{\ic\pi/8}}$

\begin{align}
&2\pi\ic\,{x_{1}^{4} \over 8x_{1}^{7}}
=\int_{0}^{\infty}{x^{4} \over 1 + x^{8}}\,\dd x
+\int_{\infty}^{0}
{r^{4}\pars{\expo{\ic\pi/4}}^{4} \over 1 + r^{8}\pars{\expo{\ic\pi/4}}^{8}}\,
\expo{\ic\pi/4}\,\dd r
\\[3mm]&=\pars{1 + \expo{\ic\pi/4}}\int_{0}^{\infty}{x^{4} \over 1 + x^{8}}\,\dd x
\end{align}

\begin{align}
&\color{#00f}{\large\int_{-\infty}^{\infty}{x^{4} \over 1 + x^{8}}\,\dd x}
=
2\bracks{{\pi\ic \over 4x_{1}^{3}}\,
{\expo{-\ic\pi/8} \over \expo{-\ic\pi/8} + \expo{\ic\pi/8}}}
=
{\pi\ic \over 2x_{1}^{4}}\,{1 \over 2\cos\pars{\pi/8}}
=
{\pi \over 2}\,{1 \over 2\cos\pars{\pi/8}}
\\[3mm]&={\pi \over 4}\,\sec\pars{\pi \over 8}
=\color{#00f}{\large{1 \over 4}\root{4 - 2\root{2}}\,\pi}
\end{align}
