Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange results with the Lerch transcendent

57 views
Skip to first unread message

Peter Luschny

unread,
Apr 27, 2013, 9:20:58 AM4/27/13
to
Hi all!

Consider this function:

ge := n -> 2^(2*n+1)*LerchPhi(-1,-n,1/2);
seq(evalf(ge(n),32),n=1..4);

What I get with my old Maple V from the last millennium:

0, -2.0640982037247673078030113720681, 0,
40.154279645840000687655931363154

What I expected was:

0, -4, 0, 80,

What is true? Give newer Maple versions different results?

Peter

Axel Vogt

unread,
Apr 27, 2013, 12:02:45 PM4/27/13
to
The same in Maple 17 (and with higher precision). However the
help says "If a is a non-positive integer, LerchPhi(z, a, v)
is a rational function of z with a pole of order 1 - a at z = 1

Now LerchPhi(z,-n,1/2); convert(%, Sum, dummy=k); gives
Sum(z^k*(1/2+k)^n,k = 0 .. infinity), then feeding your
data and evaluating gives your desired results.




Peter Luschny

unread,
Apr 27, 2013, 12:20:39 PM4/27/13
to
> > ge := n -> 2^(2*n+1)*LerchPhi(-1,-n,1/2);
> > seq(evalf(ge(n),32),n=1..4);
> > What I get with my old Maple V from the last millennium:
> > 0, -2.0640982037247673078030113720681, 0,
> > 40.154279645840000687655931363154
> > What I expected was:
> > 0, -4, 0, 80,
> The same in Maple 17 (and with higher precision). However the
> help says "If a is a non-positive integer, LerchPhi(z, a, v)
> is a rational function of z  with a pole of order 1 - a at  z = 1
> Now LerchPhi(z,-n,1/2); convert(%, Sum, dummy=k); gives
> Sum(z^k*(1/2+k)^n,k = 0 .. infinity), then feeding your
> data and evaluating gives your desired results.

Axel, thank you!

In other words this is a bug for more than 15 years.

http://www.wolframalpha.com/input/?i=Table[2^%282*n%2B1%29*LerchPhi%28-1%2C-n%2C1%2F2%29%2C+{n%2C0%2C9}]
Wolfram Alpha gives the correct result. As does Sage, by the way.

Peter

unruh

unread,
Apr 27, 2013, 12:58:11 PM4/27/13
to
On 2013-04-27, Peter Luschny <peter....@gmail.com> wrote:
>> > ge := n -> 2^(2*n+1)*LerchPhi(-1,-n,1/2);
>> > seq(evalf(ge(n),32),n=1..4);
>> > What I get with my old Maple V from the last millennium:
>> > 0, -2.0640982037247673078030113720681, 0,
>> > 40.154279645840000687655931363154
>> > What I expected was:
>> > 0, -4, 0, 80,
>> The same in Maple 17 (and with higher precision). However the
>> help says "If a is a non-positive integer, LerchPhi(z, a, v)
>> is a rational function of z ?with a pole of order 1 - a at ?z = 1
>> Now LerchPhi(z,-n,1/2); convert(%, Sum, dummy=k); gives
>> Sum(z^k*(1/2+k)^n,k = 0 .. infinity), then feeding your
>> data and evaluating gives your desired results.
>
> Axel, thank you!
>
> In other words this is a bug for more than 15 years.

Is it a bug, or a choice of a different branch cut? I do not know what
the structure is of the function.

Axel Vogt

unread,
Apr 27, 2013, 1:59:30 PM4/27/13
to
On 27.04.2013 18:58, unruh wrote:
> On 2013-04-27, Peter Luschny <peter....@gmail.com> wrote:
>>>> ge := n -> 2^(2*n+1)*LerchPhi(-1,-n,1/2);
>>>> seq(evalf(ge(n),32),n=1..4);
>>>> What I get with my old Maple V from the last millennium:
>>>> 0, -2.0640982037247673078030113720681, 0,
>>>> 40.154279645840000687655931363154
>>>> What I expected was:
>>>> 0, -4, 0, 80,
>>> The same in Maple 17 (and with higher precision). However the
>>> help says "If a is a non-positive integer, LerchPhi(z, a, v)
>>> is a rational function of z ?with a pole of order 1 - a at ?z = 1
>>> Now LerchPhi(z,-n,1/2); convert(%, Sum, dummy=k); gives
>>> Sum(z^k*(1/2+k)^n,k = 0 .. infinity), then feeding your
>>> data and evaluating gives your desired results.
>>
>> Axel, thank you!
>>
>> In other words this is a bug for more than 15 years.
>
> Is it a bug, or a choice of a different branch cut? I do not know what
> the structure is of the function.

http://www.wolframalpha.com/input/?i=32*LerchPhi(-1,-2,1/2)
gives -4, yes. But that may be false. Hm ...

May be you are right: LerchPhi(z,s,v) is defined as power series
in z for abs(z) < 1, http://dlmf.nist.gov/25.14 ( = Erdelyi ) and
the analytic extension is *not* defined for s = negative integer,
1/GAMMA(s)*Int(t^(s-1)*exp(-t*(v-1))/(exp(t)-z),t = 0 .. infinity)
and branch cut = Reals beyond 1 (like for hypergeomtric 2F1)

However if I write as a rational function (in the disc), then I do
not care at all for branch cuts (only for poles).

But z=-1 is not on the branch cut, I guess it is extenting in *s*

In Erdelyi Vol 1 page 30 there is a formula (11) which holds for
negative integers s, LerchPhi(z,-m,v) = m!/z^v*ln(1/z)^(-(m+1)) -
1/z^v*Sum(bernoulli(m+k+1,v)/k!/(m+k+1) * ln(z)^k, k=0..infinity)
But I get inconsistent results (though I checked, that his notion
of Benoulli is the same in Maple).

Peter Luschny

unread,
Apr 27, 2013, 2:57:59 PM4/27/13
to
The most detailed formula which covers our case is this:

LerchPhi[z, -n, a] = (1 - (1 - (-1)^n) UnitStep[-Re[a]])
(a^n + Sum[Binomial[n, j] PolyLog[-j, z] a^(n - j), {j, 0, n}]) +
UnitStep[-Re[a]] (1 - (-1)^n) z^Floor[-Re[a]] (z ((a + Floor[-Re[a]] +
1)^n +
Sum[Binomial[n, j] PolyLog[-j, z] (a + Floor[-Re[a]] + 1)^(n - j), {j,
0, n}]) +
UnitStep[Im[a]] (1 + Floor[-Re[a]] + Floor[Re[a]]) ((Floor[-Re[a]] +
a)^2)^(n/2))
/; Element[n, Integers] && n >= 0

Found at http://functions.wolfram.com/ZetaFunctionsandPolylogarithms/LerchPhi/03/01/02/01/0001/

So now I have to switch the group and ask an Mathematica expert what
this means ;-))
(Or someone can translate it to Maple?)

Peter

Axel Vogt

unread,
Apr 27, 2013, 3:16:50 PM4/27/13
to
convert(%, FromMma) and 0 <= n an integer gives for your task:

LerchPhi(-1,-n,1/2) = (1/2)^n+sum(binomial(n,j)*polylog(-j,-1)*(1/2)^(n-j),j = 0 .. n)

Axel Vogt

unread,
Apr 27, 2013, 3:20:27 PM4/27/13
to
Hm, I think Maple is not correct: for n = -2 +- epsilon the result
is almost - 4, while for epsilon it jumps. That is strange.

Looking into Maple's code it seems to compute in the considered case:

LerchPhi(-1,-2*k,1/2) = GAMMA(1+2*k)*Pi^(-2*k-1)*(-1)^k, 0 <= k integer

Peter Luschny

unread,
Apr 27, 2013, 3:33:46 PM4/27/13
to
> convert(%, FromMma) and 0 <= n an integer gives for your task:
> LerchPhi(-1,-n,1/2) = (1/2)^n+sum(binomial(n,j)*polylog(-j,-1)*(1/2)^(n-j),j = 0 .. n)

This can Maple V not do. But I translated by hand.
This was not difficult. I just had to figure out that
'UnitStep' translates to 'Heaviside' which is no surprise. Then
the Wolfram formula says (remember, restricted to our case!)

Lerch := proc(z,n,a) local j;
(1-(1-(-1)^n)*Heaviside(-Re(a)))*(a^n+add(binomial(n, j)*
polylog(-j, z)*a^(n-j), j = 0..n))+Heaviside(-Re(a))*
(1-(-1)^n)*z^floor(-Re(a))*(z*((a+floor(-Re(a))+1)^n+
add(binomial(n,j)*polylog(-j,z)*(a+floor(-Re(a))+1)^(n-j),j=0..n))
+Heaviside(Im(a))*(1+floor(-Re(a))+floor(Re(a)))*
((floor(-Re(a))+a)^2)^((1/2)*n)) end;

Then

myformula := n -> 2^(2*n+1)*Lerch(-1,n,1/2);
A002436 := n -> abs(myformula(2*n));
seq(A002436(i),i=0..5);

gives 1, 4, 80, 3904, 354560, 51733504.

This is what I wanted. Now I have to wait if my
attentive editor at OEIS will accept this ;-)

Peter

Axel Vogt

unread,
Apr 27, 2013, 3:34:16 PM4/27/13
to
If 0 <= n is integer and 0 < a is real then it says

LerchPhi(z,-n,a) = a^n+sum(binomial(n,j)*polylog(-j,z)*a^(n-j),j = 0 .. n)

Peter Luschny

unread,
Apr 27, 2013, 3:49:46 PM4/27/13
to
On 27 Apr., 21:34, Axel Vogt <&nore...@axelvogt.de> wrote:

> If 0 <= n is integer and 0 < a is real then it says
> LerchPhi(z,-n,a) = a^n+sum(binomial(n,j)*polylog(-j,z)*a^(n-j),j = 0 .. n)

Yes, that's nice! Thank you Axel!

Axel Vogt

unread,
Apr 28, 2013, 3:58:03 PM4/28/13
to
Here is another formula (derived from a paper of Kelly Roach):

LerchPhi(-1,-n,1/2) = -1/2*I*2^(-n)*(polylog(-n,I)-polylog(-n,-I))

It seems that this and that of MMA have problems in z=+1 instead of z=-1.

In Maple one can use

(*) LerchPhi(z,-n,a) = z*2^(n+1)*LerchPhi(z^2,-n,1/2*a+1/2)+LerchPhi(-z,-n,a)

LerchPhi(-1,-n,1/2) = -2^(n+1)*Zeta(0,-n,3/4) + (2^(-n)-1)*Zeta(-n)
= (2^(-n)-1)*Zeta(-n) + 2^(n+1)*bernoulli(n+1,3/4)/(n+1)

which gives your desired results as well.

That would have some advantage in z=+1, if n as Real approaches an integer,
while MMA online results in complex infinity - which is extension by some
rational function, I guess (Maple's help: "If a is a non-positive integer,
LerchPhi(z, a, v) is a rational function of z with a pole of order 1 - a
at z = 1.").

Hm ... puzzling. Meanwhile I think it is not an "error", it is a decision
how to extend for negative integers 'a'. More or less what "unruh" already
wrote.

Thus using it for that cases one should (must ?) say, how it should be
understood.

Peter Luschny

unread,
Apr 29, 2013, 8:45:28 AM4/29/13
to
AV> LerchPhi(-1,-n,1/2)
AV> = -2^(n+1)*Zeta(0,-n,3/4) + (2^(-n)-1)*Zeta(-n)
AV> = (2^(-n)-1)*Zeta(-n) + 2^(n+1)*bernoulli(n+1,3/4)/(n+1)
AV> which gives your desired results as well.

I cannot see this. Take the Zeta/Bernoulli form

f := n -> (2^(-n)-1)*Zeta(-n)+2^(n+1)*bernoulli(n+1,3/4)/(n+1);
seq(2^(n+1)*f(n),n=0..9);
1, 0, -1, 0, 5, 0, -61, 0, 1385, 0

which is fine, take the LerchPhi form

seq(evalf(2^(n+1)*LerchPhi(-1,-n,1/2)),n=0..9);
1, 0, -.5160245510, 0, 2.509642478, 0, -61, 0, 1385, 0

which is rubbish.

AV> Meanwhile I think it is not an "error", it is a
AV> decision how to extend for negative integers 'a'.

Then please explain the rationale behind the values -.5160245510 and
2.509642478 in the last example.

Peter
0 new messages