Integral involving $\sin({\ln{x}})$ I need help with the following integral
$$I=\int_0^\infty \frac{\sin{(\ln x)}}{x^4+x^2+1}dx$$
I know the answer is
$$I=-\frac{\pi}{2}\frac{\sinh{\frac{\pi}{6}}}{\cosh{\frac{\pi}{2}}}$$
but I can't find how to get there. I tried integration by parts with $u=\sin({\ln{x}})$ but it went nowhere. I tried substituting $u=\ln{x}$, but I was clueless after that. Not much else seems very sensible.
 A: Let's denote
$$I(a)=\int_0^\infty \frac{\sin{(a\ln x)}}{x^4+x^2+1}dx$$
If the method of complex integration is acceptable, we can do the following.
Making the substitution $x=e^{\pi t}$, after straightforward transformation we get
$$I=-\frac{\pi}{4}\int_{-\infty}^\infty\frac{\sin(\pi at)\sinh\pi t}{(\cosh\pi t-\frac{1}{2})(\cosh\pi t+\frac{1}{2})}dt$$
$$=-\Im\frac{\pi}{4}\int_{-\infty}^\infty\frac{e^{i\pi at}\sinh\pi t}{(\cosh\pi t-\frac{1}{2})(\cosh\pi t+\frac{1}{2})}dt=-\Im\,J$$
Now we go in the complex plane and consider a rectangular contour

Integrals along the paths $[1]$ and $[2]$ vanish at $R\to\infty$, and we get
$\displaystyle\frac{\pi}{4}\oint\frac{e^{i\pi az}\sinh\pi z}{(\cosh\pi z-\frac{1}{2})(\cosh\pi z+\frac{1}{2})}dz=J(1+e^{-\pi a})$
$$=2\pi i\underset{z=i/3; \,2i/3}{\operatorname{Res}}\frac{\pi}{4}\frac{e^{i\pi az}\sinh\pi z}{(\cosh\pi z-\frac{1}{2})(\cosh\pi z+\frac{1}{2})}\,,$$
because we have only two simple poles inside the contour (at $z=\frac{i}{3}, z=\frac{2i}{3}$).
The residues evaluation is straightforward:
$$J(1+e^{-\pi a})=\frac{\pi^2 i}{2}\bigg(\frac{e^{-\frac{\pi a}{3}}\sinh\frac{\pi i}{3}}{\pi i\sin\frac{\pi}{3}}-\frac{e^{-\frac{2\pi a}{3}}\sinh\frac{2\pi i}{3}}{\pi i\sin\frac{2\pi}{3}}\bigg)$$
$$J\Big(e^\frac{\pi a}{2}+e^{-\frac{\pi a}{2}}\Big)=\frac{\pi i}{2}\Big(e^\frac{\pi a}{6}-e^{-\frac{\pi a}{6}}\Big)\,\,\Rightarrow\,\,\boxed{\,\,I=-\Im J=-\frac{\pi}{2}\frac{\sinh\frac{\pi a}{6}}{\cosh\frac{\pi a}{2}}\,\,}$$
A: After $x=t^{1/2}$, the integral equals $\frac12\Im f(\frac{1+i\sqrt3}2,\frac{1-i\sqrt3}2,\frac{i-1}2)$ where $$f(a,b,p)=\int_0^\infty\frac{t^p\,dt}{(a+t)(b+t)}=\frac{a^p-b^p}{a-b}\frac{\pi}{\sin p\pi}$$ for $a,b,p\in\mathbb{C}$ with $a,b\notin\mathbb{R}_{\leqslant0}$ and $|\Re p|<1$. This formula may be verified for real $a,b>0$ and $-1<p<0$, say (using partial fractions and the beta function), and extended to the general case using analytic continuation.
A: We want to evaluate the integral $I$ given by
$$I=\text{Im}\left(\int_0^\infty \frac{e^{i\log(x)}}{x^4+x^2+1}\,dx\right)$$
Moving to the complex plane, we have for $R>1$
$$\begin{align}
\oint_{C_R} \frac{e^{i\log(z)}}{z^4+z^2+1}\,dz&=(1+e^{-\pi})\int_0^R  \frac{e^{i\log(|x|)}}{x^4+x^2+1}\,dx+\int_0^\pi \frac{e^{i\log(R)-\theta}}{(iRe^{i\theta})^4+(iRe^{i\theta})^2+1}\,iRe^{i\theta}\,d\theta\\\\
&=2\pi i \text{Res}\left(\frac{e^{i\log(z)}}{z^4+z^2+1}, z=\pm\frac12+i\frac{\sqrt3}2\right)\\\\
&=2\pi i \frac{e^{-2\pi/3}}{3+i\sqrt3}+2\pi i \frac{e^{-\pi/3}}{-3+i\sqrt3}
\end{align}$$
Letting $R\to \infty$ and taking the imaginary part yields
$$\begin{align}
\int_0^\infty \frac{\sin(\log(x))}{x^4+x^2+1}\,dx&=\frac{\pi }{\cosh(\pi/2)}\left(\frac{1}{4}e^{-\pi/6}-\frac14 e^{\pi/6}\right)\\\\
&=-\frac{\pi}{2}\frac{\sinh(\pi/6)}{\cosh(\pi/2)}
\end{align}$$
as was to be shown!
A: Using algebra.
We can obtain the antiderivative using first the roots of unity
$$x^4+x^2+1=(x-a)(x-b)(x-c)(x-d)$$
$$a=-\frac {1+i \sqrt{3}}2 \qquad b=\frac {1+i \sqrt{3}}2\qquad c=\frac {1-i \sqrt{3}}2\qquad d=-\frac {1-i \sqrt{3}}2$$ Using partial fraction decomposition
$$\frac 1{x^4+x^2+1}=\frac{1}{(a-b) (a-c) (a-d) (x-a)}+\frac{1}{(b-a) (b-c) (b-d) (x-b)}+\frac{1}{(c-a) (c-b) (c-d) (x-c)}+\frac{1}{(d-a)
   (d-b) (d-c) (x-d)}$$ and we face four integrals
$$I_k=\int \frac{\sin (\log (x))}{x-k}\,dx$$ Using the Gaussian hypergeometric function
$$4k\,I_k=(1+i) x^{1+i} \, _2F_1\left(1,1+i;2+i;\frac{x}{k}\right)+(1-i) x^{1-i} \,
   _2F_1\left(1,1-i;2-i;\frac{x}{k}\right)$$
Combining the four integrals, at the lower bound, the result is $0$. Where remains the problem is to find the limit when $x\to \infty$.
