# How to evaluate $\int^\infty_0 \log^2(x)\exp(-x)\,dx$

I attempted to solve this equation using integration by part, but it leads me no where and it gets too complicated to solve. I hope some can give me a hint how to approach this integral

$$\int^\infty_0 \log^2(x)\exp(-x)\,dx$$

Thanks,

$$\Gamma(t+1)=\int_0^\infty x^te^{-x}\,dx.$$ Differentiating twice under the integral sign gives $$\Gamma''(t+1)=\int_0^\infty (\log x)^2x^te^{-x}\,dx.$$ Take $t=0$.

With Gamma function $$\Gamma(n)=\int_0^\infty e^{-x}x^{n-1}dx$$ then $$\int_0^\infty e^{-x}\log^2xdx=\Gamma''(1)$$

• ..which, by the way, turns out to be $\gamma^2 + \pi^2/6$ according to Maple. – Robert Israel Nov 22 '17 at 5:40

To show the value of $\Gamma''(1)$ does indeed reduce to the result @Robert Israel states, from the definition for the digamma function $\psi(x)$, we have $$\psi (x) = \frac{\Gamma'(x)}{\Gamma (x)}.$$ Taking the logarithm of both sides followed by differentiating with respect to $x$ gives $$\frac{\psi^{(1)}(x)}{\psi (x)} = \frac{\Gamma''(x)}{\Gamma' (x)} - \frac{\Gamma' (x)}{\Gamma (x)} = \frac{\Gamma'' (x)}{\Gamma'(x)} - \psi (x). \tag1$$ Here $\psi^{(1)}(x)$ is the polygamma function of order one.

Since $\Gamma'(x) = \psi (x) \Gamma (x)$, after rearranging (1) and solving for $\Gamma''(x)$ we have $$\Gamma'' (x) = \Gamma (x) \left [\{\psi (x)\}^2 + \psi^{(1)} (x) \right ].$$ Setting $x = 1$ in the above gives $$\Gamma''(1) = \Gamma (1) \left [\{\psi (1) \}^2 + \psi^{(1)} (1) \right ].$$

Values for each of the functions that appear in the above expression can be found. We have $\Gamma (1) = 1$ which is trivial, $\psi (1) = - \gamma$ where $\gamma$ is the Euler-Mascheroni constant (a proof of this can be found here). Finally, for $\psi^{(1)}(1)$ the polygamma function of order one (or trigamma function) is defined by the series $$\psi^{(1)}(x) = \sum^\infty_{n = 0} \frac{1}{(x + n)^2}.$$ Setting $x = 1$ and shifting the index by $n \mapsto n - 1$ we have $$\psi^{(1)}(1) = \sum^\infty_{n = 1} \frac{1}{n^2} = \frac{\pi^2}{6},$$ the sum corresponding to the well-known Basel problem.

Thus $$\Gamma''(1) = \gamma^2 + \frac{\pi^2}{6},$$ as announced.