TITLE: Integral $\int_0^{\infty} \log(x) e^{-x^2} \mathrm{d}x = -\frac{1}{4}\sqrt{\pi} (\gamma + \log(4)).$
QUESTION [5 upvotes]: While trying to compute the expected value $E[\log(X)]$ for a normally distributed variable $X$ I found the following integral
$$\int_{0}^{\infty}\log\left(x\right) {\rm e}^{-x^{2}}\,{\rm d}x
=-\,{1 \over 4}\,\,\sqrt{\,\pi\,}\,\left[\,\gamma + \log\left(4\right)\,\right]
$$. Can anybody explain this?

REPLY [7 votes]: Consider the integral
$$I(a) = \int_0^{\infty} dx \, x^a \, e^{-x^2}$$
Sub $x=y^{1/2}$ and get
$$I(a) = \frac12 \int_0^{\infty} dy \, y^{(a-1)/2} \, e^{-y} = \frac12 \Gamma\left ( \frac{a+1}{2}\right)$$
The integral in question is 
$$I'(0) =\frac12  \left [\frac{d}{da}  \Gamma\left ( \frac{a+1}{2}\right)\right ]_{a=0} = \frac14 \Gamma\left (\frac12\right) \psi\left ( \frac12 \right)$$
where
$$\Gamma\left (\frac12\right)=\sqrt{\pi}$$
$$\psi\left ( \frac12 \right) = -(\log{4}+\gamma)$$

REPLY [2 votes]: Your result is correct for the integral. I uppose that your question is : how to arrive there ? In fact, concerning the antiderivative, integrate by parts [u = Log(x)] and you arrive to
Sqrt[Pi] Log[x] Erf[x] / 2 - Sqrt[Pi] /2 Integral[Erf(x) / x dx]
The result of the last integration involves the hypergeometric FPQ function.  
I really apologize for this awful format but I am almost blind and I do not "see" what I am typing.