TITLE: Calculate $\int_0^\infty\frac{\sin(x)\log(x)}{x}\mathrm dx$.
QUESTION [6 upvotes]: Calculate $\displaystyle\int_0^\infty\dfrac{\sin(x)\log(x)}{x}\mathrm dx$.

I tried to expand $\sin(x)$ at zero, or use SI(SinIntegral) function, but it did not work. Besides, I searched the question on math.stackexchange, nothing found.
Mathematica tells me the answer is $-\dfrac{\gamma\pi}{2}$, I have no idea how to get it.
Thanks for your help!

REPLY [5 votes]: $\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\color{#f00}{\int_{0}^{\infty}{\sin\pars{x}\ln\pars{x} \over x}\,\dd x} =
\int_{0}^{\infty}\sin\pars{x}\ln\pars{x}\int_{0}^{\infty}\expo{-xt}\,\dd t\,\dd x
\\[5mm] = &\
\int_{0}^{\infty}\
\overbrace{\Im\int_{0}^{\infty}\ln\pars{x}\expo{-\pars{t - \ic}x}\,\dd x}
^{\ds{\equiv\ \mc{J}}}\ \,\dd t\label{1}\tag{1}
\end{align}

Hereafter the $\ds{\ln}$-branch-cut runs along $\ds{\left(-\infty,0\right]}$ with $\ds{\ln\pars{z}\ \,\mrm{arg}}$ given by
  $\ds{-\pi < \mrm{arg}\pars{z} < \pi}$.


\begin{align}
\mc{J} & \equiv
\Im\int_{0}^{\infty}\ln\pars{x}\expo{-\pars{t - \ic}x}\,\dd x =
\Im\bracks{{1 \over t - \ic}\int_{0}^{\pars{t - \ic}\infty}
\ln\pars{x \over t - \ic}\expo{-x}\,\dd x}
\\[5mm] & =
-\,\Im\braces{{t + \ic \over t^{2} + 1}\int_{\infty}^{0}\bracks{\ln\pars{x \over \root{t^{2} + 1}} + \arctan\pars{1 \over t}\ic}\expo{-x}\,\dd x}
\\[5mm] & = 
\Im\braces{{t + \ic \over t^{2} + 1}\bracks{%
\int_{0}^{\infty}\ln\pars{x}\expo{-x}\,\dd x -
{1 \over 2}\ln\pars{t^{2} + 1}+ \arctan\pars{1 \over t}\ic}}
\end{align}

Note that
  
  $\ds{\int_{0}^{\infty}\ln\pars{x}\expo{-x}\,\dd x =
\left.\partiald{}{\mu}\int_{0}^{\infty}x^{\mu}\expo{-x}\,\dd x\,
\right\vert_{\ \mu\ =\ 0} = \Gamma\,'\pars{1}\ =\ \overbrace{\Gamma\pars{1}}^{\ds{=\ 1}}\
\overbrace{\Psi\pars{1}}^{\ds{-\gamma}}\ =\ -\gamma\quad}$ where $\ds{\Gamma}$ 
  
  and $\ds{\Psi}$ are the Gamma and Digamma Functions, respectively. Then,

\begin{align}
\mc{J} & \equiv \bbox[8px,#ffe,border:0.1em groove navy]{%
\Im\int_{0}^{\infty}\ln\pars{x}\expo{-\pars{t - \ic}x}\,\dd x} =
-\,{\gamma \over t^{2} + 1} -
{1 \over 2}\,{\ln\pars{t^{2} + 1} \over t^{2} + 1} +
{t\arctan\pars{1/t} \over t^{2} + 1}
\\[5mm] & =
\bbox[8px,#ffe,border:0.1em groove navy]{-\,{\gamma \over t^{2} + 1} +
\totald{}{t}\bracks{{1 \over 2}\,\arctan\pars{1 \over t}\ln\pars{t^{2} + 1}}}
\label{2}\tag{2}
\end{align}

Note that$\ds{{1 \over 2}\,\arctan\pars{1 \over t}\ln\pars{t^{2} + 1}}$ vanishes out when $\ds{t \to \infty}$ and $\ds{t \to 0^{+}}$.

By replacing \eqref{2} in \eqref{1}:
\begin{align}
&\color{#f00}{\int_{0}^{\infty}{\sin\pars{x}\ln\pars{x} \over x}\,\dd x} =
-\gamma\int_{0}^{\infty}{\dd t \over t^{2} + 1} =
\color{#f00}{-\,{1 \over 2}\,\gamma\pi}
\end{align}