Evaluate $\int_0^\infty{\frac{\ln x \sin x}{x}dx}$

It is pretty straightforward: the Laplace transform of $\sin(x)$ is $\frac{1}{s^2+1}$ and the inverse Laplace transform of $\frac{\log x}{x}$ is $-\gamma-\log(s)$, hence $$ \int_{0}^{+\infty}\frac{\log(x)\sin(x)}{x}\,dx = \int_{0}^{+\infty}\frac{-\gamma-\log(s)}{1+s^2}\,ds = -\frac{\gamma\pi}{2} $$ since $\int_{0}^{+\infty}\frac{\log s}{1+s^2}\,ds$ vanishes by symmetry ($s\mapsto \frac{1}{s}$).


I thought it might be instructive to present another approach that uses real analysis only, which complement my answer using contour integration (SEE THIS ANSWER). We shall make use of Frullani's integral. To that end we proceed.


Note that from Frullani's Integral we have

$$\log(x)=\int_0^\infty \frac{e^{-t}-e^{-xt}}{t}\,dt\tag1$$


Using $(1)$, we can write the integral of interest as

$$\begin{align} \int_0^\infty \frac{\log(x)\sin(x)}{x}\,dx&=\int_0^\infty\left(\int_0^\infty \frac{e^{-t}-e^{-xt}}{t}\,dt\right) \frac{\sin(x)}{x}\,dx\\\\ &=\int_0^\infty \frac1t \color{blue}{\int_0^\infty \frac{\sin(x)}{x}(e^{-t}-e^{-xt})\,dx} \,dt\\\\ &=\int_0^\infty \frac1t\color{blue}{\left(\frac\pi2e^{-t}-\pi/2+\arctan(t)\right)}\,dt\tag2 \end{align}$$


Integrating by parts the integral on the right-hand side of $(2)$ with $u=\frac\pi2e^{-t}-\pi/2+\arctan(t)$ and $v=\frac1t$ reveal

$$\begin{align} \int_0^\infty \frac1t\color{blue}{\left(\frac\pi2e^{-t}-\pi/2+\arctan(t)\right)}\,dt&=-\int_0^\infty \log(t)\color{blue}{\left(-\frac\pi2 e^{-t}+\frac1{t^2+1}\right)}\,dt\\\\ &=-\frac\pi2\gamma \end{align}$$

since $$\int_0^\infty \frac{\log(t)}{t^2+1}\,dt\overbrace{=}^{t\mapsto1/t}\int_0^\infty \frac{\log(1/t)}{t^2+1}\,dt\implies \int_0^\infty \frac{\log(t)}{t^2+1}\,dt=0$$


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!