Computing $\int_{0}^{\infty} \frac{x^2 + a}{x^6 + a^3}dx$ I wish to compute

$$\int_{0}^{\infty} \frac{x^2 + a}{x^6 + a^3}dx, \quad a>0$$

but have no contour to work with. Does anyone have ideas on how to compute this integral?
 A: This integral can be evaluated with calculus only:
\begin{align*}
\int_{0}^{\infty} \frac{x^2 + a}{x^6 + a^3} \, dx
&= \frac{1}{a^{3/2}} \int_{0}^{\infty} \frac{x^2 + 1}{x^6 + 1} \, dx \tag{1} \\
&= \frac{1}{a^{3/2}} \int_{0}^{\infty} \frac{1}{(x - \frac{1}{x})^2 + 1} \, \frac{dx}{x^2} \\
&= \frac{1}{2a^{3/2}} \int_{0}^{\infty} \frac{1+\frac{1}{x^2}}{(x - \frac{1}{x})^2 + 1} \, dx \tag{2} \\
&= \frac{1}{2a^{3/2}} \int_{-\infty}^{\infty} \frac{1}{u^2 + 1} \, du \quad (u = x-1/x) \\
&= \frac{\pi}{2a^{3/2}}.
\end{align*}
Explanation.


*

*For (1), we utilized the substitution $x \mapsto \sqrt{a} x$.

*For (2). the substitution $x \mapsto 1/x$ gives
$$ I := \int_{0}^{\infty} \frac{1}{(x - \frac{1}{x})^2 + 1} \, \frac{dx}{x^2} = \int_{0}^{\infty} \frac{1}{(x - \frac{1}{x})^2 + 1} \, dx. $$
Thus it follows that
$$ I = \frac{1}{2}(I + I) = \frac{1}{2} \int_{0}^{\infty} \frac{1 + \frac{1}{x^2}}{(x - \frac{1}{x})^2 + 1} \, dx. $$

A: Hints:
We have that:
$$x^6+a^3=(x^2+a)(x^4-ax^2+a^2)$$
The above biquadratic's discriminant is
$$\Delta = a^2-4a^2=-3a^2=\left(\sqrt3\,ia\right)^2$$
so you actually have to integrate
$$\int_0^\infty\frac{dx}{\left(x^2-\frac{1-\sqrt3\,ia}2\right)\left(x^2-\frac{1+\sqrt3\,ia}2\right)}$$
Take a half circle $\;C_r:=[-R,R]\cup\gamma_R:=\{z\in\Bbb C\;,\;\;z=Re^{it}\;,\;\;\text{Im}\,z\ge 0\}\;$ and you only have, apparently (check this carefully) two poles within this region.
A: \begin{align*}
\int_{0}^{\infty} \frac{x^2 + a}{x^6 + a^3} \, dx
&= \frac{1}{a^{3/2}} \int_{0}^{\infty} \frac{x^2 + 1}{x^6 + 1} \, dx  \\
&= \frac{1}{a^{3/2}} \int_{0}^{1} \frac{x^2 + 1}{x^6 + 1} \, dx+\frac{1}{a^{3/2}} \int_{1}^{\infty} \frac{x^2 + 1}{x^6 + 1} \, dx\\
&= \frac{1}{a^{3/2}} \int_{0}^{1} \frac{x^2 + 1}{x^6 + 1} \, dx+\frac{1}{a^{3/2}} \int_{0}^{1} \frac{x^{-2} + 1}{x^{-6} + 1}x^{-2} \, dx \mbox{ (for the second:}x \rightarrow 1/x )\\
&= \frac{1}{a^{3/2}} \int_{0}^{1} \frac{x^2 + 1}{x^4-x^2 +1} \, dx\\
&= \frac{1}{a^{3/2}} \int_{0}^{\frac{\pi}{2}} \frac{\sin^2t + 1}{\sin^4t-\sin ^2t +1} \, d\sin t =I\\
\end{align*}
Now by symmetry and $t \rightarrow \pi/2-t$ we obtain
\begin{align}
2I&=\frac{1}{a^{3/2}}\int_{0}^{\frac{\pi}{2}} \frac{\sin^2t + 1}{\sin^4t-\sin ^2t +1} \, \cos tdt+\frac{1}{a^{3/2}}\int_{0}^{\frac{\pi}{2}} \frac{\cos^2t + 1}{\cos^4t-\cos ^2t +1} \, \sin tdt\\
&=\frac{1}{a^{3/2}}\int_{0}^{\frac{\pi}{2}}\frac{\cos t +\sin t}{1-\cos t \sin t} \, dt\\
&=\frac{1}{a^{3/2}}\int_{0}^{\frac{\pi}{2}}\frac{(-2)(-\cos t -\sin t)}{1+(\cos t- \sin t)^2} \, dt\\
&=\frac{-2}{a^{3/2}}\arctan(\cos t- \sin t)\Big|_0^{\pi/2}\\
&=\frac{\pi}{a^{3/2}}
\end{align}
