       Re: Bug with Limit, Series and ProductLog ?

• To: mathgroup at smc.vnet.net
• Subject: [mg61443] Re: [mg61402] Bug with Limit, Series and ProductLog ?
• From: "Carl K. Woll" <carl at woll2woll.com>
• Date: Wed, 19 Oct 2005 02:16:38 -0400 (EDT)
• References: <200510180644.CAA11217@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```did wrote:
> With Mathematica 5.2 Windows I obtain
>
> In:=Limit[ ProductLog[Exp[a/x]/x]-a/x,x->0]
> Out= -Log[a]
>
> which seems correct. But, setting a=1, I get
>
> In:=Limit[ ProductLog[Exp[1/x]/x]-1/x,x->0]
> Out=-8
>
> which is inconsistent with the previous result
> (except if Log is Infinity !).
>
> Worse, with Series I get
>
> In:=Series[ ProductLog[Exp[a/x]/x]-a/x,{x,0,5}]
>
> Out=\!\(\*
>  InterpretationBox[
>    RowBox[{\(-\(a\/x\)\), "+", "Indeterminate", "+",
>      InterpretationBox[\(O[x]\^6\),
>        SeriesData[ x, 0, {}, -1, 6, 1],
>        Editable->False]}],
>    SeriesData[ x, 0, {
>      Times[ -1, a], Indeterminate}, -1, 6, 1],
>    Editable->False]\)
>
> Setting a=1 in the Series gives a complex answer.
>
> How can I workaround the problem and get the correct
> expansion for In?
> Thanks,
> D.
>

Here is one approach. Define f as your function:

In:=
f[x_] := ProductLog[Exp[a/x]/x] - a/x

Now, differentiate with respect to x:

In:=
f'[x]
Out=
a/x     a/x                a/x
a E       E                  E
(-(------) - ----) x ProductLog[----]
3        2                 x
a         x        x
-- + -------------------------------------
2                              a/x
x          a/x                 E
E    (1 + ProductLog[----])
x

Notice the presence of the same ProductLog as exists in f. We can replace
these occurrences of ProductLog with f[x]+a/x and obtain a differential
equation for f. Since f already has a definition, I'll use g:

In:=
g'[x] == f'[x] /. _ProductLog -> g[x] + a/x // Simplify
Out=
g[x]
g'[x] == -(--------------)
a + x + x g[x]

It's convenient to rewrite this equation as ode==0, where ode is:

In:=
ode = Numerator[Together[g'[x] - f'[x] /. _ProductLog -> g[x] + a/x]]
Out=
g[x] + a g'[x] + x g'[x] + x g[x] g'[x]

Now, we simply find the series expansion of this expression and set all the
terms to 0:

In:=
sol = Solve[ode + O[x]^2 == 0, {g', g''}]
Out=
g (2 + g)             g
{{g'' -> ---------------, g' -> -(----)}}
2                     a
a

Plug this solution into your power series for g:

In:=
g[x] + O[x]^3 /. sol[]
Out=
2
g x   g (2 + g) x        3
g - ------ + ------------------ + O[x]
a                2
2 a

Finally, use the value of g you obtained:

In:=
% /. g -> -Log[a]
Out=
2
Log[a] x   (2 - Log[a]) Log[a] x        3
-Log[a] + -------- - ---------------------- + O[x]
a                   2
2 a

It's a simple matter to obtain even higher orders of the series simply by
repeating the above procedure. I checked the results for various values of a
and x, and it seems like the above expansion is correct.

Carl Woll
Wolfram Research

```

• Prev by Date: Re: Re: Solving Diophantine Equations
• Next by Date: Re: Re: problem solving polynomial equations
• Previous by thread: Re: Bug with Limit, Series and ProductLog ?
• Next by thread: Re: Bug with Limit, Series and ProductLog ?