How can I compute this integral?
$$
\int\_{0}^{+\infty} \left( \frac{\ln(x)}{e^x}\right)^2 dx
$$



Compute $ \int_{0}^{+\infty} \left( \frac{\ln(x)}{e^x}\right)^2 dx $
Let
$$f(a):=\int\_0^\infty x^{a-1}e^{-2x}\,dx.$$
Then
$$f''(1)=\int\_0^\infty \ln^2x\,e^{-2x}\,dx,$$
which is the integral in question.


On the other hand, $f(a)=2^{-a}\,\Gamma(a)$, and hence
the integral in question is
$$f''(1)=\frac{\ln^2 2}2 - \Gamma'(1)\ln2
+ \Gamma''(1)/2
=\frac{\pi^2}{12}+ \frac{(\gamma +\ln2)^2}2=1.6293\dots,$$
where $\gamma=0.57721\dots$ is the Euler gamma constant.


(The second equality in the latter display follows because $\Gamma'(1)=-\gamma$ and $\Gamma''(1)=\gamma^2+\pi^2/6$. In turn, the latter two equalities can be obtained using the last two displays in Section [Recurrence relation](https://en.wikipedia.org/wiki/Polygamma_function#Recurrence_relation).)


