TITLE: Evaluate $\int_0^\infty{\frac{\ln x \sin x}{x}dx}$
QUESTION [9 upvotes]: Evaluate$$\int_0^\infty{\frac{\ln x \sin x}{x}dx}$$
I don't know where to start with this integral. Mathematica shows that $-\frac{\gamma\pi}2$ is the answer, so I don't think that it is easy to be solved.

REPLY [4 votes]: I wanted to present a way forward using contour integration that is complementary to the real analysis solution I presented earlier HERE.  To the end, we proceed.


Using the principal value of the complex logarithm, Cauchy's Integral Theorem Guarantees that for $0<\epsilon<R$
$$\begin{align}
0&=\int_\epsilon^R \frac{e^{ix}\log(x)}{x}\,dx+\int_0^{\pi/2}\frac{e^{iRe^{i\phi}}\log(Re^{i\phi})}{Re^{i\phi}}\,iRe^{i\phi}\,d\phi\\\\
&+\int_R^\epsilon \frac{e^{-x}\log(ix)}{ix}\,i\,dx+\int_{\pi/2}^0\frac{e^{i\epsilon e^{i\phi}}\log(\epsilon e^{i\phi})}{\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi\tag 1
\end{align}$$

For the second integral on the right-and side of $(1)$, we find that 
$$\begin{align}
\left|\int_0^{\pi/2}\frac{e^{iRe^{i\phi}}\log(Re^{i\phi})}{Re^{i\phi}}\,iRe^{i\phi}\,d\phi\right|&\le \int_0^{\pi/2}|\log(R)+i\phi|e^{-R\sin(\phi)}\,d\phi\\\\
&\le (\log(R)+\pi/2) \int_0^{\pi/2}e^{-2R\phi/\pi}\,d\phi\\\\
&=(\log(R)+\pi/2) \left(\frac{1-e^{-R}}{2R/\pi}\right)\tag2
\end{align}$$
which clearly vanishes in the limit as $R\to\infty$.

For the fourth integral on the right-and side of $(1)$, we find that 
$$\begin{align}
\text{Im}\left(\int_{\pi/2}^0\frac{e^{i\epsilon e^{i\phi}}\log(\epsilon e^{i\phi})}{\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi\right)&=-\frac\pi2\log(\epsilon)+O(\epsilon\log(\epsilon))\tag3
\end{align}$$

Hence, taking the imaginary part of $(1)$ and letting $R\to \infty$ and $\epsilon\to 0$ and using $(2)$ and $(3)$ reveals
$$\begin{align}
\int_0^\infty \frac{\log(x)\sin(x)}{x}\,dx= \frac\pi2 \lim_{\epsilon\to 0}\left(\int_\epsilon^\infty \frac{e^{-x}}{x}\,dx +\log(\epsilon)\right)\tag4
\end{align}$$
Finally, integrating by parts the integral on the right-hand side of $(4)$ with $u=e^{-x}$ and $v=\log(x)$ yields
$$\begin{align}
\int_0^\infty \frac{\log(x)\sin(x)}{x}\,dx&=\frac\pi2\lim_{\epsilon\to 0}\left(-e^{-\epsilon}\log(\epsilon)+\int_\epsilon^\infty \log(x)e^{-x}\,dx+\log(\epsilon)\right)\\\\
&=\frac\pi2 \int_0^\infty \log(x)e^{-x}\,dx\\\\
&=-\frac\pi2\gamma
\end{align}$$
as was to be shown!