# Integral of li(x)

Here I talked about special functions, and at the end of the post I said I would explain how to integrate these special functions. So here I am, showing you how to integrate the function li(x). If you gave it a try, let me know in the comments if you used this approach!

$\int&space;\text{li}(x)\,&space;dx$

As we saw here, u-substitution won’t work, but integration by parts will!

$u=\text{li}(x)\;&space;\;&space;\;&space;\;&space;dv=dx$ $du=\frac{1}{\ln(x)}\,&space;dx\;&space;\;&space;\;&space;\;&space;v=x$

We know that the li(x) is the integral of 1/ln(x), so the derivative of li(x) is 1/ln(x).

$x\text{li}(x)-\int\frac{x}{\ln(x)}\,&space;dx$

Now, if we use integration by parts again, and let u be x and dv be 1/ln(x), we will get the integral we had at the beginning, and if we do the other way around we will just make things worse, since we would have ln^2(x) at the denominator and a few more things. We can try u-substitution though.

$u=\ln(x)\;&space;\;&space;\;&space;\;&space;du=\frac{1}{x}dx\rightarrow&space;dx=x\,&space;du$ $\int&space;\frac{x}{u}x\,&space;du$

Since we are integrating with respect to u, we don’t want any x. We know that u=ln(x), therefore x=e^u.

$\int&space;\frac{e^u}{u}e^u\,&space;du=\int&space;\frac{e^{2u}}{u}du$

Mmmh… this looks a lot like the integral of e^x/x, which is equal to the function Ei(x). The difference is not the u, as the result would be the same with any variable, but the exponent of e, which here is 2u instead of u. But we can fix this! How? With another substitution!

$t=2u\;&space;\;&space;\;&space;\;&space;dt=2du\rightarrow&space;du=\frac{1}{2}dt$ $\int&space;\frac{e^t}{u}\frac{1}{2}dt=\frac{1}{2}\int&space;\frac{e^t}{u}dt$

Since t=2u, u=(1/2)t.

$\frac{1}{2}\int&space;\frac{e^t}{\frac{1}{2}t}dt=\frac{1}{2}\int&space;\frac{e^t}{t}2dt=\int\frac{e^t}{t}dt$

As we saw here, the integral of e^t/t is equal to Ei(t).

$\int\frac{e^t}{t}dt=\text{Ei}(t)$

Don’t write the “+C” yet because we need to undo all of the substitutions.

$\text{Ei}(t)\overset{u}{\rightarrow}&space;\text{Ei}(2u)\overset{x}{\rightarrow}&space;\text{Ei}(2\ln(x))$

If you remember, after we performed integration by parts, we got

$x\text{li}(x)-\int\frac{x}{\ln(x)}dx$

and since we know that this integral is equal to Ei(2ln(x)), we get the final answer:

$\int&space;\text{li}(x)\,&space;dx=x\text{li}(x)-\text{Ei}(2\ln(x))+C$

And that’s it!

If you liked this post give it a like and if you have any doubt, answers or suggestions write down in the comments, I will be happy to reply! Subscribe and stay tuned for more integrals!

Support my site!

I put all of my efforts to make this site as good as possible. If you would like, you can help my site grow with a small donation! I would really appreciate it.

\$1.00

Join 31 other subscribers.