How to Solve $Li(X)$ Logarithmic Integral for $X > 1$
$\begingroup$

I am trying to write a program in JAVA to find the values of $li(x)$, but I do not understand how to compute $li(x)$ when $x > 1$.

For the sake of this question, let’s make $x = 2$, as this will allow for similarity in the answers.

Any manner of solution is appreciated, however, preferably none of the steps involved in finding the solution can use anything infinite (infinity, infinite summation, infinite series, limits, etc.) as they cannot be expressed in code.

I have included a link to an online calculator for $li(x)$ which also displays the graph:

.

Thank you very much for your help.

$\endgroup$
6

2 Answers

$\begingroup$

En efficient algorithm, 24-bits precision, can be found in this book : J.Spanier, K.B.Oldham, "An Atlas of Functions", Hemisphere Publishing Co. N-Y., 1987.

Since it is an old edition, a copy of page 355 is shown below.

For $x=2$ the output is $\quad\text{li}(2)\simeq 1.045164$

More information, from the above referenced document :

$\endgroup$
6
$\begingroup$

You said you’d consider using a series expansion, so try using $$\operatorname{li}(x)=\gamma+\ln\ln x + \sum_{k=1}^{\infty}\frac{\ln^k x}{k!\:k}$$

(eq. 14 here) where $\gamma$ is the Euler-Mascheroni constant.

$\endgroup$
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest