For quite sometime I have been stuck. I do not know how to approach this problem. Bear with me if this is already asked:
How can I evaluate $\int_0^\infty\ln(x)e^{-x} dx$?
My trial so far is to use integration by parts but i have no idea how to do it:
$$
\begin{aligned}
\text{let } U=&~\ln(x) &dv=e^{-x}dx\\
du =&~\frac{1}{x}dx&V=-e^{-x}\\
\int_0^\infty \ln(x)e^xdx =& -\ln(x)e^{-x}{\LARGE|}_{0}^\infty +\int_0^\infty \frac{e^{-x}}{x}dx
\end{aligned}
$$
But this doesn't seem right since the first part seems to go to infinity instead of a constant value. Also iI cannot even do the second part. Using R's integrate(function(x) log(x)*exp(-x), 0, Inf)
I get -0.57721567
which shows that this integration exists. Can someone help me out?
Best Answer
By Feynman trick we have that
$$\int_0^\infty\log x \: e^{-x}\:dx = \frac{d}{da}\int_0^\infty x^a e^{-x}\:dx\Biggr|_{a=0} = \Gamma'(1)$$
where $\Gamma(a)$ is the Gamma function.