TITLE: Improper Integral $\int_0^\infty\log(x)e^{-x^2}dx$
QUESTION [7 upvotes]: Why is:
$$\int_0^\infty\log(x)e^{-x^2}dx=-\frac{\sqrt\pi}4(\gamma+\log4)$$
And does anybody have a reference?

REPLY [3 votes]: This answer simply serves to fill in some of the details of Robert Israel's and Claude Leibovici's answers.

Computing the Integral in Terms of $\boldsymbol{\Gamma^{\hspace{.25mm}\prime}\hspace{-1.5mm}\left(\frac12\right)}$
As Robert Israel points out
$$
\begin{align}
\int_0^\infty x^\alpha\,e^{-x^2}\,\mathrm{d}x
&=\frac12\int_0^\infty x^{\frac{\alpha-1}2}\,e^{-x}\,\mathrm{d}x\\
&=\frac12\Gamma\left(\frac{\alpha+1}2\right)\tag{1}
\end{align}
$$
and taking the derivative at $\alpha=0$ gives
$$
\int_0^\infty\log(x)\,e^{-x^2}\,\mathrm{d}x=\frac{\Gamma^{\hspace{.25mm}\prime}\hspace{-1.5mm}\left(\frac12\right)}4\tag{2}
$$

Computing $\boldsymbol{\Gamma^{\hspace{.25mm}\prime}\hspace{-1.5mm}\left(\frac12\right)}$
As Claude Leibovici notes, $\Gamma^{\hspace{.25mm}\prime}\hspace{-1.5mm}\left(x\right)$ is related to $\psi(x)$.
Consider the Digamma function
$$
\begin{align}
\psi(x)
&=\frac{\Gamma^{\hspace{.25mm}\prime}\hspace{-1.5mm}\left(x\right)}{\Gamma(x)}\\
&=\frac{\mathrm{d}}{\mathrm{d}x}\log(\Gamma(x))\tag{3}
\end{align}
$$
The relation $\Gamma(x+1)=x\Gamma(x)$ and $(3)$ yields
$$
\psi(x+1)=\frac1x+\psi(x)\tag{4}
$$
Thus, using $H(n)=\log(n)+\gamma+O\!\left(\frac1n\right)$, we get
$$
\begin{align}
\psi\left(n+\tfrac12\right)-\psi\left(\tfrac12\right)
&=\sum_{k=1}^n\frac1{k-\frac12}\\
&=2\sum_{k=1}^n\frac1{2k-1}\\[3pt]
&=2H(2n)-H(n)\\[6pt]
&=\log(n)+2\log(2)+\gamma+O\!\left(\frac1n\right)\tag{5}
\end{align}
$$
The Mean Value Theorem says that there is a $\xi_-\in(x-1,x)$ so that
$$
\begin{align}
\log(x-1)
&=\log(\Gamma(x))-\log(\Gamma(x-1))\\
&=\frac{\mathrm{d}}{\mathrm{d}x}\log(\Gamma(\xi_-))\tag{6}
\end{align}
$$
Furthermore, there is a $\xi_+\in(x,x+1)$ so that
$$
\begin{align}
\log(x)
&=\log(\Gamma(x+1))-\log(\Gamma(x))\\
&=\frac{\mathrm{d}}{\mathrm{d}x}\log(\Gamma(\xi_+))\tag{7}
\end{align}
$$
Since $\log(\Gamma(x))$ is convex, $(6)$ and $(7)$ say that
$$
\log(x-1)\le\frac{\mathrm{d}}{\mathrm{d}x}\log(\Gamma(x))\le\log(x)\tag{8}
$$
Thus, $(3)$ and $(8)$ imply that $\psi\!\left(n+\frac12\right)=\log(n)+O\!\left(\frac1n\right)$ and therefore, $(5)$ says
$$
\psi\left(\tfrac12\right)=-2\log(2)-\gamma\tag{9}
$$
Since $\Gamma\!\left(\frac12\right)=\sqrt\pi$, $(3)$ and $(9)$ imply
$$
\Gamma^{\hspace{.25mm}\prime}\hspace{-1.5mm}\left(\tfrac12\right)=-\sqrt\pi\,(2\log(2)+\gamma)\tag{10}
$$

Summary
Therefore, $(2)$ and $(10)$ yield
$$
\int_0^\infty\log(x)\,e^{-x^2}\,\mathrm{d}x=-\frac{\sqrt\pi}4(2\log(2)+\gamma)\tag{11}
$$