Originally, I recently answered this integral on Quora. I have just copied the same text in this answer.
We want to evaluate the improper integral
$$ I = \int\limits_0^\infty\frac{x^9}{(1+x)(x^{12}+x^6+1)}\,\mathrm dx $$
My approach will be complex analysis based, but before applying that directly, let's simplify the integrand a bit.
Using the substitution $x\mapsto \frac1x$, we get
$$ I = \int\limits_0^\infty\frac{x^2}{(1+x)(x^{12}+x^6+1)}\,\mathrm dx $$
Adding the two,
$$\begin{align}I &= \frac12\int\limits_0^\infty \frac{x^2(1+x^7)}{(1+x)(x^{12}+x^6+1)}\,\mathrm dx \\ &=\frac12\int\limits_0^\infty\frac{x^2(x^6-x^5+x^4-x^3+x^2-x+1)} {x^{12}+x^6+1}\,\mathrm dx \\ &= \frac12\underbrace{\int\limits_0^\infty\frac{x^8-x^7+x^6}{x^{12}+x^6+1}\,\mathrm dx }_{x\mapsto \frac1x} + \frac12\int\limits_0^\infty\frac{x^4-x^3+x^2}{x^{12}+x^6+1}\,\mathrm dx-\frac12\underbrace{\int\limits_0^\infty \frac{x^5}{x^{12}+x^6+1}\,\mathrm dx}_{=I_2} \\ &= \int\limits_0^\infty \frac{x^4-x^3+x^2}{x^{12}+x^6+1}\,\mathrm dx -\frac12I_2 \\ &= \sum_{k=2}^4 (-1)^k\underbrace{\int\limits_0^\infty\frac{x^k}{x^{12}+x^6+1}\,\mathrm dx }_{\equiv I_k}-\frac12 I_2 \end{align}$$
$$ I = \sum_{k=2}^4(-1)^kI_k-\frac12I_2 \tag 1$$
As compared to $I_k$, $I_2 $ can be computed with much more ease. Using the substitution $x^6=t$,
$$\begin{align}I_2 &= \frac16\int\limits_0^\infty\frac{\mathrm dt}{t^2+t+1}\\ &= \left. \frac16\cdot\frac2{\sqrt3}\arctan \Big(\frac{2t+1}{\sqrt3}\Big)\right|_0^\infty \\ &= \dfrac\pi{9\sqrt3}\end{align}$$
Now, it's time to evaluate $I_k$. This is going to be quite complicated.
Let
$$f(z) = \dfrac{z^k}{z^{12}+z^6+1}$$
Consider the contour $\Gamma = \gamma_1\cup\gamma_2\cup\gamma_3 $ where $\gamma_1 $ runs from $0$ to $R$, $\gamma_2 $ is the circular arc from $R$ to the line $z=Re^{i\pi/3}$ and $\gamma_3 $ is the straight line itself, ending to $0$.
For $R=10$, the contour will look like this

Here red, blue and green are $\gamma_1,\gamma_2,\gamma_3 $ respectively. For anyone interested, I used Desmos to get this plot.
Now,
$$\begin{align}\oint_\Gamma f(z)\,\mathrm dz &= \int\limits_0^R \frac{x^k}{x^{12}+ x^6+1}\,\mathrm dx + \int\limits _0^{\pi/3}\frac{(R e^{i\theta})^k}{(R e^{i\theta})^{12}+(R e^{i\theta })^ 6+1}\cdot i R e^{i\theta}\, \mathrm d\theta + \int\limits_R^0 \frac{(xe^{i\pi/3})^k}{(xe^{i\pi/3} )^{12}+(xe^{i\pi/3})^6+1} \cdot e^{i\pi/3}\,\mathrm dx \\\oint_\Gamma f(z)\,\mathrm dz &= (1-e^{i\pi(k+1)/3})\int\limits_0^R \frac{x^k}{x^{12}+x^6+1}\,\mathrm dx +i \int\limits_0^{\pi/3}\frac{R^{k+1}e^{i\theta(k+1)}}{R^{12}e^{12i\theta}+R^6e^{6i\theta}+1}\,\mathrm d\theta \end{align}$$
Clearly, as $R\to \infty$, the second integral tends to $0$. So,
$$\lim_{R\to \infty} \oint_\Gamma f(z)\,\mathrm dz = (1-e^{i\pi(k+1)/3})I_k$$
$$ I_k = \mathfrak R \Big[\frac1{1-e^{i\pi(k+1)/3}}\lim_{R\to \infty}\oint_\Gamma f(z)\,\mathrm dz \Big] \tag 2$$
The result follows due to the fact that $I_k$ is real.
Now, the denominator has $12$ zeroes out of which $2$ are inside our contour, namely $z=e^{i\pi/9},e^{2i\pi/9}$, which will be the poles of our integrand. To obtain this result, I used Wolfram|Alpha.
I used Wolfram|Alpha to calculate the residues, as simplifying the $11$ factors of the denominator which will be left while taking the limit is a tedious job.
$$\begin{align} \text{Res}_{z=e^{i\pi/9}} f(z) &= \frac1{6\sqrt3}\exp\Big(\frac{i\pi}{18}(2k+17)\Big) \\ \text{Res}_{z=e^{2i\pi/9}} f(z) &= \frac1{6\sqrt3}\exp\Big(\frac{i\pi}{18}(4k+25)\Big) \end{align}$$
So,
$$\begin{align}\oint_\Gamma f(z)\,\mathrm dz &= 2\pi i \Big[ \frac1{6\sqrt3 } \exp\Big(\frac{i\pi}{18}(4k+25)\Big) +\frac1 {6\sqrt3}\exp \Big(\frac{i\pi}{18}(2k+17)\Big) \Big] \\ &= \frac{\pi i}{3\sqrt 3} \Big[ \exp\Big(\frac{i\pi}{18}(4k+25)\Big) +\exp\Big(\frac{i\pi}{18}(2k+17)\Big) \Big] \end{align}$$
Finally using $(2)$,
$$I_k = -\frac\pi{6\sqrt3}\bigg\{ \sin\Big(\frac\pi{18}(2k+17)\Big)+\sin\Big(\frac\pi{18}(4k+25)\Big)+ \frac{\sin(\frac\pi3(k+1))}{1-\cos(\frac\pi3(k+1))}\Big[ \cos \Big(\frac\pi{18}(2k+17)\Big)+\cos \Big(\frac\pi{18}(4k+25)\Big)\Big]\bigg\} $$
Now, using $(1)$, we conclude that
$$\boxed{\boxed{\int\limits_0^\infty\frac{x^9}{(x+1)(x^{12}+x^6+1)}\,\mathrm dx = \frac\pi{9\sqrt3}+\frac\pi{6\sqrt3}\sin\frac\pi{18}-\frac{4\pi}9\sin\frac\pi9-\frac\pi{18}\cos\frac\pi{18}+\frac\pi{3\sqrt3}\cos\frac\pi9\approx 0.172733}}$$
Using Wolfram|Alpha, the difference between this answer and the numerical value of the integral is $-8.83515\times 10^{-13}$.