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.


Solution 1:

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.