Recently I came across the following integral - $$\int_{0}^{\infty}\frac{\log x \sin x}{e^x}\mathrm{d}x$$ One way to do it is to rewrite $\sin$ in terms of exponent, and then to relate to derivative of Gamma function. However this invokes complex analysis. Are there other ways using only real analysis techniques for solving this integral.
In the standard approach we try to manipulate $\int_{0}^{\infty}x^ae^{-x} \sin x\mathrm{d}x$ to arrive at the Gamma function, but I do not have any idea, how to do it without rewriting $\sin x$. And if it is only rewriting it, and using some trivial arithmetic with complex numbers as if they were reals, it is OK, but I do not see how to do it.
Maybe we should work with the original integral. However I think that we should at some point come up with the Gamma, as the answer contains Euler-Macheroni constant, which is related to derivatives of Gamma, and I do not see how otherwise we could reach this particular constant.
\begin{align}\int^\infty_0 e^{-x}\log(x)\sin(x)\,dx &= \int^\infty_0 e^{-x}\sin(x)\int^{\infty}_{0}\frac{e^{-z}-e^{-xz}}{z}\, dz\,dx \\ &=\int^\infty_0\frac{1}{z} \left(e^{-z}\int^{\infty}_{0}e^{-x}\sin(x)\,dx-e^{-x(z+1)}\sin(x)\, dx\right)\,dz\\&=\int^\infty_0\frac{1}{z} \left(\frac{e^{-z}}{2}-\frac{1}{(z+1)^2+1}\right)\,dz\\&=\frac{1}{2}\int^\infty_0\log(z) e^{-z}\,dz-\int^\infty_0 \frac{2(1+z)\log(z)}{((1+z)^2+1)^2}\,dz \end{align}
The first integral can be evaluated in terms of the digamma function , the second has an anti-derivative.