TITLE: A closed form for: $\int_{0}^{\infty} \frac{1}{(x-\log x)^2}dx$
QUESTION [22 upvotes]: Is it possible to find a closed-form expression for this integral?

$$\int_{0}^{\infty} \frac{1}{(x-\log x)^2}dx$$

Generalization of the Integral:

$$\int_{0}^{\infty} \frac{1}{(x-\log x)^{p}}dx$$

where, $\log x$ is a natural logarithm, $p\in\mathbb{Z^{+}}_{≥2}$
The indefinite integral can not be expressed by elementary mathematical functions according to Wolfram Alpha.
I can add a visual plot.

So, I dont know, is it possible to find a closed-form or not. But, I have a numerical solution:

$$\int_{0}^{\infty} \frac{1}{(x-\log x)^2}dx≈2.51792$$

REPLY [2 votes]: To Yuriy S: the method is good, you just forgot to consider all branches of Lambert W, the solution to $ e^x -x =0 $ is $ x_n= - W_{n}(-1) $ for $ n \in \mathbb{Z}$ so the integral is
$$
2\pi i \sum_{n=0}^{\infty} \text{Res}\left( \frac{e^x}{\left( e^x -x\right )^2}, -W_n(-1)\right) = 2\pi i \sum_{n=0}^{\infty}  -\frac{W_n(-1)}{\left( 1+ W_n(-1)\right )^3}
$$
Mathematica code:
Abs[Sum[NResidue[E^x/(E^x - x)^2, {x, -ProductLog[n, -1]},WorkingPrecision -> 50], {n, 0, 10000}]*2*Pi]

Real part of the sum converges VERY slowly to 0.
Sorry can't comment