<s>[INST] Compute integral $\int_{-\infty}^\infty \frac{x^4}{1+x^8} \, dx$ Compute the integral. 
$$\int_{-\infty}^\infty \frac{x^4}{1+x^8} \, dx$$
The answer at the back of the book is 
$$\frac{\pi}{4\sin(\frac{3\pi}{8})}$$
 [/INST] Supplementing Fly by Night's answer with a trick sometimes handy when calculating the residues at a root of unity.
Write $P(z)=z^4$, $Q(z)=z^8+1$, $f(z)=P(z)/Q(z)$.


*

*The poles in the upper half plane are $z=z_k=e^{(2k+1)\pi i/8},k=0,1,2,3$.  Their complex conjugates are the other four poles, so they are all simple. A trick is to use the fact that $z_k^8=-1$. Therefore
$$ Res(f;z_k)=\frac{P(z_k)}{Q'(z_k)}=\frac{z_k^4}{8z_k^7}=\frac{z_k^5}{8z_k^8}=-\frac18z_k^5.$$

*For further simplification it is helpful to observe that for all the poles $z_k$ we have $z_k^4=\pm i$. The choices of the signs work out nicely in that the contributions of $z_0$ and $z_3$ (resp. $z_1$ and $z_2$) sum up to simple real values of a trig function. The known values
$$
\cos\frac{\pi}8=\frac12\sqrt{2+\sqrt2},\quad\sin\frac{\pi}8
=\frac12\sqrt{2-\sqrt2}
$$
come in handy, and
$$
\begin{aligned}
\int&=2\pi i\sum_{k=0}^3Res(f,z_k)\\
&=-\frac{\pi i}4(z_0^5+z_1^5+z_2^5+z_3^5)\\
&=-\frac{\pi i}4(iz_0-iz_1+iz_2-iz_3)\\
&=\frac{\pi}4[(z_0-z_3)-(z_1-z_2)]\\
&=\frac{\pi}4[2\sin\frac{3\pi}8-2\sin\frac{\pi}8]\\
&=\frac{\pi}4[2\cos\frac{\pi}8-2\sin\frac{\pi}8]\\
&=\frac{\pi}4\left(\sqrt{2+\sqrt2}-\sqrt{2-\sqrt2}\right).
\end{aligned}
$$
</s>