       Re: question about the inverse li function

• To: mathgroup at smc.vnet.net
• Subject: [mg65379] Re: [mg65348] question about the inverse li function
• From: "Carl K. Woll" <carlw at wolfram.com>
• Date: Wed, 29 Mar 2006 06:34:18 -0500 (EST)
• References: <200603280905.EAA26284@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Capet Arthur wrote:
> the question...
>
> i've measured C(x), wich is equal to li(I(x)), where li denotes the
> logarithmic integral function. I would like to compute I(x)= li^(-1)
> (C(x))
>
> how can i compute the inverse of the logarithmic integral function ?
> Is there a function Inverse[_function] ?
>
> thanx a lot
>
>
> Arthur Capet, ULG, Belgium
>
>

Arthur,

There is the function InverseFunction. For example:

In:=
InverseFunction[Sin]

Out=
ArcSin

Unfortunuately, Mathematica does not have a built in function for the

In:=

Out=

So, we'll have to work harder to figure out the inverse. This question
has come up on mathgroup before, with 3 basic possibilities:

1. Plot LogIntegral[x] and then extract the plot points. Use
Interpolation to construct an InterpolatingFunction using these plot points.

2. Use FindRoot to find the inverse at a bunch of points, and then use
Interpolation.

3. Use homotopic continuation. That is, find the inverse of LogIntegral
at some point x, and then construct an ODE to determine how the inverse
varies as x varies.

I am usually the person advocating method 3. I'll show you how it works
in your example. First, form the equation for the inverse x[y]:

eqn = y == LogIntegral[ x[y] ]

Now, construct an ODE satisfied by the inverse, x:

In:=
D[eqn,y]

Out=
x'[y]
1 == ---------
Log[x[y]]

The next step is to use NDSolve on this ODE, and so we need an initial
value. However, the inverse is multivalued for negative input, since
LogIntegral ranges from 0 to -Infinity as x goes from 0 to 1, and then
LogIntegral ranges from -Infinity to Infinity as x goes from 1 to
Infinity. So, we'll need to construct two inverses: one for 0<x<1 and
one for 1<x<Infinity. For 0<x<1 we'll use the initial value

and for 1<x<Infinity we'll use

Now we are ready to use NDSolve.

low = x /.
NDSolve[{D[eqn, y], x[LogIntegral[1/2]] == 1/2}, x, {y, -5, 5}][];
high = x /.
NDSolve[{D[eqn, y], x[LogIntegral] == 2}, x, {y, -5, 5}][];

Some tests:

In:=

Out=
2.

Out=
-2.

Out=
-2.

As you may have noticed, I used the range -5<y<5. You can change this
range to whatever you need. Also, as I pointed out earlier, there are no
real values of x on the low branch for which LogIntegral[x] is positive.
There are complex values, but the branch chosen by my implementation
doesn't agree with the branch used by Mathematica for LogIntegral:

In:=

Out=
1. + 3.14159 I

i[x_] := low[ C[x] ]

or

i[x_] := high[ C[x] ]

Carl Woll
Wolfram Research

```

• Prev by Date: Re: Re: Re: Sum problem
• Next by Date: Re: Re: Fourier expansion of (Cos[t]+A Cos[3 t])^1/3