# Evaluate $\int_{0}^{+\infty} e^{-x} \ln^{2} x \text{d}x$ without complex analysis

Is possible to evaluate $$\int_0^{+\infty} e^{-x} \ln^{2} x \text{d}x$$ without using complex analysis?

• @Axion004. Make an answer of it. It is to nice for staying in comments. Jan 24, 2020 at 5:02

This is a long comment that has been turned into an answer. The approach applies known relationships between the gamma function, digamma function, and Euler–Mascheroni constant.

Using the fact that $$\int_0^\infty x^{a-1} \ e^{-bx} dx=\frac{\Gamma(a)}{b^{\ a}}\tag{1}$$

differentiate both sides of $$(1)$$ with respect to $$a$$ twice to get

$$\int_0^\infty (\ln x)^2\ x^{a-1} \ e^{-bx}\ dx=\frac{\Gamma(a)\Big(-2\psi(a)\ln b+(\psi(a))^2 +\psi'(a)+(\ln b)^2\Big)}{b^{\ a}}\tag{2}$$ now set $$a=1$$ in $$(2)$$ $$\int_0^\infty (\ln x)^2\ e^{-bx}\ dx=\frac{2\gamma\ln b+\gamma^2 +\dfrac{\pi^2}{6}+(\ln b)^2}{b}$$

Finally set $$b=1$$ we get

$$\int_0^\infty (\ln x)^2\ e^{-x}\ dx=\gamma^2+\dfrac{\pi^2}{6}$$

A similar approach was shown inside this answer in which it is shown that

$$\int_0^\infty \ln x\ e^{-x}\ dx=-\gamma$$

• Thanks for making an answer and, for sure, $+1$ Jan 24, 2020 at 11:57