TITLE: Evaluate $\int_{1}^{\infty}e^{-x}\ln^{2}\left(x\right)dx$
QUESTION [11 upvotes]: Evaluate :$$\int_{1}^{\infty}e^{-x}\ln^{2}\left(x\right)\mathrm{d}x$$
I've tried to solve this with some elegant substitutions like $t=e^x$ or $t=\ln\left(x\right)$ . I've also tried to integrate by parts without any success. any help would be good.

REPLY [8 votes]: Starting the integral from $1$ is in some sense unnatural here, and as a result there is  no closed form solution outside of those involving hypergeometric functions or the incomplete Gamma function.  The integral should start from $0$, as starting from $0$ usually goes hand in hand with integrating $e^{-x}$ against another function, as the additive character $e^{-x}$ lives on the additive group of the reals $[0,\infty)$, not $[1,\infty)$.  This is related to how the incomplete Gamma Function often has no nice closed form, and is more difficult to work with than the Gamma Function itself, and that for the Gamma function, we should start from $0$.  It is not by chance that the Laplace Transform starts from $0$ instead of $1$, and we can view $\int_0^\infty e^{-x} \log^2x dx$ as the value of the Laplace transform of $\log^2x$ evaluated at a point.  In particular the integral when started from $0$ behaves nicely, and we can  prove that $$\int_0^\infty e^{-x}\log^2 x dx=\gamma^2+\frac{\pi^2}{6},$$ which I will now show.

Proof:  Consider the exponential generating series  $$F(z)=\sum_{k=0}^{\infty}\frac{z^{k}}{k!}\int_{0}^{\infty}e^{-x}\left(\log x\right)^{k}dx.$$ Rearranging, this equals $\int_{0}^{\infty}e^{-x}x^{z}dx=\Gamma(z+1),$  and so $$\int_{0}^{\infty}e^{-x}\left(\log x\right)^{2}dx=\frac{d^{2}}{dz^{2}}\Gamma(z+1)\biggr|_{z=0}=\Gamma''(1).$$ Taking the logarithm of the Weierstrass product for $\Gamma(z+1),$ and differentiating, we have that
$$\frac{\Gamma'(z+1)}{\Gamma(z+1)}=-\gamma+\sum_{n=1}^{\infty}\frac{z}{n(n+z)}.$$ Upon differentiating both sides of the above equation, we obtain
$$\frac{\Gamma''(z+1)}{\Gamma(z+1)}-\frac{\left(\Gamma'(z+1)\right)^{2}}{\Gamma^{2}(z+1)}=\sum_{n=1}^{\infty}\frac{1}{(n+z)^{2}},$$ and so $$\Gamma''(1)=\Gamma'(1)^{2}+\sum_{n=1}^{\infty}\frac{1}{n^{2}}=\gamma^{2}+\frac{\pi^{2}}{6},$$ which proves the result.