# Evaluate or simplify $\int\frac{1}{\ln x}\,dx$

I did a bit of work on this, but I'm not so sure about the parts towards the end. Starting with$$\int\frac{1}{\ln x}\,dx$$$$u=\ln x,1=\frac{dx}{du}\frac{1}{x},dx=x\,du,dx=e^{\ln x}du,dx=e^u\,du$$$$\int\frac{e^u}{u}\,du=\int\frac{1}{u}e^u\,du=\int\frac1u\sum_{n=1}^\infty\frac{u^n}{n!}\,du=\int\sum_{n=1}^\infty\frac{u^{n-1}}{n!}\,du$$$$\sum_{n=1}^\infty\frac{u^n}{n\cdot n!}=\sum_{n=1}^\infty\frac{\ln(x)^n}{n\cdot n!}$$which WolframAlpha tells me converges to $-\ln\left(-\ln x\right)-\Gamma\left(0,-\ln x\right)-\gamma$. I'm not sure what happened in this last step.

-
This is the logarithmic integral that you are considering, which is nonelementary... –  Ｊ. Ｍ. Apr 20 '12 at 16:29
The $\gamma$ is Euler's gamma constant, concerning which there is much information in texts and on websites. I don't know what WA means by $\Gamma(x,y)$ but surely some documentation is available? –  Gerry Myerson Apr 21 '12 at 0:48
have you tried integration by parts? –  nanme Jun 26 '12 at 18:36
@user1434040: That won't work. The integral is non-elementary. –  Pedro Tamaroff Jun 26 '12 at 18:38
@GerryMyerson $\Gamma(x,y)$ is the incomplete gamma function –  dot dot Aug 31 '12 at 0:31

Well, you made a minor error when you substituted the MacLaurin series for $\exp(x)$; you should have $$\int\frac{e^{u}}{u}\,du=\int\frac{1}{u}e^u\,du=\int\frac{1}{u}\sum_{n=0}^{\infty}\frac{u^n}{n!}\,du=\ln(u)+\int\sum_{n=1}^{\infty}\frac{u^{n-1}}{n!}\,du$$ and then evaluating the integral we should get $$\int\sum_{n=1}^{\infty}\frac{u^{n-1}}{n!}\,du=\sum^{\infty}_{n=1}\frac{u^{n}}{n!n}$$ Thus you should get $$\int\frac{e^{u}}{u}\,du=\ln(u)+\sum^{\infty}_{n=1}\frac{u^{n}}{n!n}=\ln\bigl(\ln(x)\bigr)+\sum^{\infty}_{n=1}\frac{\ln(x)^{n}}{n!n}$$ This is up to some constant of integration, of course. But look, that's precisely the $li(x)$ function, which the integral describes! See, e.g., Equation (14) of Mathworld's Li function article.
Addendum: If you look at Wolfram Alphas' answer again, an alternate form of the sum is given by $$-\gamma +1/2 \left(\ln\left(\frac{1}{\ln(x)}\right)-\ln(\ln(x))\right)+li(x)$$ Observe the parenthetic term cancels with the extra term outside the sum.