TITLE: Evaluate the integral $\int_0^{\infty}e^{-x} \sin x \log x ~ dx$
QUESTION [9 upvotes]: I need help with this integral
$$\int_0^{\infty}e^{-x} \sin x \log x ~  dx$$
WolframAlpha gives the answer to be $\displaystyle \frac{1}{8} (-4 \gamma + π - 2\log(2))$, a curious expression with three fundamental constants.

REPLY [3 votes]: $\newcommand{\Log}{\operatorname{Log}}\newcommand{\Im}{\mathfrak{Im}}$Here is an approach using integration under the integral sign (Feynman's trick)
First of all, let $I$ be the integral in the question. One has a term $\log(x)$ but that is also the extra term one gets after differentiating $x^{t}$ with respect to $t$, so that is what inspired me to write this. 
Define the function:
\begin{align}
G(t) := \int^\infty_0 x^{t-1}\sin(x) e^{-x}\,dx 
\end{align}
So by Feynman one gets (verify this):
\begin{align}
G'(1) = I
\end{align}
The problem we have right now is: can we find $G(t)$ in a form we can do something with? The answer is yes. You either see it as Mellin transform, i.e.  $G(t)=\mathcal M [e^{-x}\sin(x)] (t)$ and know it by heart (I don't to be honest). Or you see the "$\Gamma$-function"  in it.  What I mean with the latter is the following, notice that:
\begin{align}
G(t) = \Im \left(\int^\infty_0 x^{t-1}e^{(i-1)x}\,dx  \right)
\end{align}
Consider the circle sector contour with angle $\pi/4$ on the second quadrant to "translate" that in an expression with $\Gamma$-function (the details are straightforward computations which I leave for you). Using that one can conclude:
\begin{align*}
\int^\infty_0 x^{t-1}e^{(i-1)x}\,dx= e^{-t\log(2)/2} e^{i\frac \pi 4 t} \Gamma(t)
\end{align*} 
By taking the imaginary part of that one gets:
\begin{align}
G(t) = e^{-t\log(2)/2}\sin\left( \frac \pi 4 t\right)\Gamma(t)
\end{align}
Hence:
\begin{align}
G'(t) = -\frac{\log(2)}{2} e^{-t\log(2)/2}\sin\left( \frac \pi 4 t\right)\Gamma(t) + \frac{\pi}{4}e^{-t\log(2)/2}\cos\left( \frac \pi 4 t\right)\Gamma(t) + e^{-t\log(2)/2}\sin\left( \frac \pi 4 t\right)\Gamma'(t)
\end{align}
Now we almost have the result, namely:
\begin{align*}
I = G'(1) &= -\frac{\log(2)}{2} e^{-\log(2)/2}\frac{\sqrt[]{2}}{2} + \frac{\pi}{4}e^{-\log(2)/2}\frac{\sqrt[]{2}}{2} + e^{-\log(2)/2}\frac{\sqrt[]{2}}{2}\Gamma'(1)\\
&= \frac{1}{2}\left[ -\frac{\log(2)}{2} + \frac{\pi}{4}+\Gamma'(1) \right]
\end{align*}
By using Feynman's trick (again):
\begin{align*}
\Gamma'(1) = \int^\infty_0 \log(x)e^{-x}\,dx = -\gamma
\end{align*}
Finally we can conclude that:
\begin{align*}
\int^\infty_0 e^{-x}\sin (x)\log (x)\,dx = \frac{1}{8}\left( -2\log(2) + \pi-4\gamma \right)
\end{align*}