<s>[INST] Does $\int_1^{\infty}\frac{x^2\tan^{-1}(ax)}{x^4+x^2+1}dx$ have closed form? I have been trying to find the closed form for integral below $$\int_1^{\infty}\frac{x^2\tan^{-1}(ax)}{x^4+x^2+1}dx ,\; \; a>0 $$
My progress to this integral  $$\cong\frac{\pi^2}{8\sqrt 3}+\frac{\pi}{8}\log(3)-\frac{\pi}{6a\sqrt 2}+\frac{1}{2a^3}\left(\frac{\log(3)}{4} -\frac{\pi}{12\sqrt 3}\right)-\frac{1}{5a^5}\left(\frac{1}{2}-\frac{\pi}{12\sqrt 2}-\frac{\log(3)}{4}\right)+\frac{1}{7a^7}\left(\frac{\pi}{6\sqrt 3}-\frac{1}{2}\right)+\frac{1}{108a^9} +\frac{1}{9a^9}\left(\frac{\log(3)}{9}-\frac{\pi}{12\sqrt 3}\right)-\frac{1}{24a^{11}}+\cdots $$ Using the series of $\tan(ax)$ the above form is obtained. However, I dont find closed form for it. If $a\to\infty+$,then it is equal to $\frac{\pi^2}{8\sqrt 3}+\frac{\pi}{8}\log(3)$.
 [/INST] You could simplify the problem using
$$\frac{x^2}{x^4+x^2+1}=\frac {x^2}{(x^2-r)(x^2-s)}=\frac 1{r-s} \left(\frac{r}{x^2-r}-\frac{s}{x^2-s}\right)$$ where
$$r=-\frac{1+i \sqrt{3}}{2} \qquad \text{and} \qquad s=-\frac{1-i \sqrt{3}}{2}$$ So, the problem boils down to the computation of
$$I(t)=\int_1^\infty \frac{\tan ^{-1}(a x)}{x^2-t} \,dx$$ where $t$ is a complex number.
Surprising or not, there is an antiderivative (a monster found by a CAS).
So, there is a closed form. I saw it !
</s>