<s>[INST] Evaluate $\int_{0}^{\infty} \frac{x^2+x+1}{x^6+x^4+1} dx$ $$\int_{0}^{\infty} \frac{x^2+x+1}{x^6+x^4+1} dx $$
Wolfram says $1.80276\ldots $
Calculating this seems complicated to me because the residues are pretty hard to find and I have tried the infinite residue method but it didn't work out.
 [/INST] Without complex analysis.
From a formal point of view, there is closed form solution.
Let $(a,b,c)$ to be the roots of $y^3+y^2+1=0$; one is real and negative (say $a$) and the other two $(b,c)$ are complex conjugate.
$$\frac{x^2+x+1}{x^6+x^4+1}=\frac{x^2+x+1}{(x^2-a)(x^2-b)(x^2-c)}$$ Now, using partial fraction decomposition, the rhs write
$$-\frac{1}{(a-b) (a-c) (b-c)}\left(\frac{(x+a+1) (c-b)}{x^2-a}+\frac{(b-a) (x+c+1)}{x^2-c}+\frac{(a-c) (x+b+1)}{x^2-b} \right)$$ So, we face three integrands of the form
$$\frac{A+B x}{x^2-d}=\frac{A}{x^2-d}+\frac B 2\frac {2x}{x^2-d }$$
$$\int_0^t \frac{A+B x}{x^2-d}\,dx=-\frac{A}{\sqrt{d}}\tanh ^{-1}\left(\frac{t}{\sqrt{d}}\right)+\frac B 2 \log \left(1-\frac{t^2}{d}\right)$$ Now, the problem is to make $t\to \infty$ and to simplify.
The real solution is given by
$$a=-\frac{1}{3} \left(1+2 \cosh \left(\frac{1}{3} \cosh
   ^{-1}\left(\frac{29}{2}\right)\right)\right)$$ I prefer to avoid typing the explicit solutions of$(b,c)$.
</s>