List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] bug in sum?
| [MUG] bug in sum? |
|
Author: Max_joern
Posted: Wed, 22 May 2002 10:33:19 +0200
|
>> From: "max_joern"
Dear MUG,
I recently stumbled over this sum: (I'm using Maple 7)
Sum((k+1)*ee^k,k = 3 .. infinity). This should converge for
abs(ee)<1. We know that the sum from 0 to infinity equals in that
case 1/(1-ee)^2 which is checked by maple:
> sum((k+1)*(ee)^k,k=0..infinity);
1/((ee-1)^2)
(no convergence check b.t.w.)
If we plug in ee=-0.5 we obtain:
> subs(ee=-0.5,%);
0.4444444
Now Sum((k+1)*ee^k,k = 3 .. infinity) should be Sum((k+1)*ee^k,k = 0
.. infinity) - Sum((k+1)*ee^k,k = 0 .. 2), right? This we can
calculate for the case ee=-0.5 to be equal to 0.4444444-0.75=
-.3055555556. But here the surprise: if we use maple to calculate the
sum from 3 to infinity with arbitrary value of ee first and then
substitute ee=-0.5 we get:
> sum((k+1)*(ee)^k,k=3..infinity);
4*ee^3*(-9/ee^(1/2)/(-ee+1)^2*LegendreP(1,-3,(ee+1)/(-ee+1))-3/2*1/(ee-1)^5*(-ee+1)^2/ee+1/(ee-1)^5*(-ee+1)^2/ee^2-1/4*1/(ee-1)^5*(-ee+1)^2/ee^3-1/4*1/ee^3*(-ee+1))
> evalf(subs(ee=-0.5,%));
-.1666666667-0.*I
which is clearly different from the expected result. I assume that
already the expression with the associated Legendre functions is wrong
but I'm not sure. We get the expected result though if we take the
limit:
> sum((k+1)*(ee)^k,k=3..n);
ee^(n+1)*(-2+(n+1)*ee-n)/(ee-1)^2-ee^3*(-4+3*ee)/(ee-1)^2
>limit(subs(ee=-0.5,%),n=infinity);
-.3055555556
I suppose, this is a bug?
Thanks for a clarification,
Jorn Justiz
________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr!
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13
|
| [MUG] Re: bug in sum? |
|
Author: Maple User Group
Posted: Tue, 28 May 2002 18:50:06 -0400
|
>> From: Maple User Group "maple_gr"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 27 May 2002 09:55:20 +0400
From: Vladimir Bondarenko "vvb"
To: "maple-list"
Subject: bug in sum?
Dear Jorn Justiz,
You identified a BUG.
> kernelopts(version);
`Maple 7.00, IBM INTEL NT, May 28 2001 Build ID 96223`
> sum((k+1)*a^k, k=2..infinity): evalf(subs(a=1/2, %));
12.
> sum((k+1)*(1/2)^k, k=2..infinity);
2
This bug is absent in Maple V, Release 5
> kernelopts(version);
Maple V, Release 5, IBM INTEL NT, Nov 27 1997, WIN-55NC-567980-7
> sum((k+1)*a^k,k=2..infinity): evalf(subs(a=1/2, %));
2.
Best wishes,
Vladimir Bondarenko
Applied mathematician
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 27 May 2002 15:15:07 +0200
From: Preben Alsholm "ifakpa"
To: "maple-list" "max_joern"
Subject: bug in sum?
I think that the expression with LegendreP is OK, but think that the
problem lies in the procedure `evalf/LegendreP`. In that procedure's
statement 18 all values of LegendreP(v,u,z) having integral values of
v and u and having v<abs(u) are set to 0.
>>From Abramowitz & Stegun 8.1.2 we find that
LegendreP(1, -3, (1+x)/(1-x))
= (1/6)*x^(3/2)*hypergeom([-1,2], [4], -x/(1-x) ).
Maple itself simplifies the right hand side to
1/12*x^(3/2)*(x-2)/(x-1). If you in the output from
sum((k+1)*x^k,k=3..infinity); replace LegendreP(...) with this
expression, then the sum-result is seen to be correct.
If I'm correct in claiming that there is a bug in `evalf/LegendreP`
then the bug is present in Maple V, 5.1, Maple 6, Maple 7, and
unfortunately also in Maple 8.
In Maple V, 5.1 and Maple 6 your problem with the sum doesn't show up
since the result doesn't contain LegendreP.
--
Preben Alsholm
Institut for matematik (Department of Mathematics)
DTU (Technical University of Denmark)
| >> From: "max_joern"
|
| I recently stumbled over this sum: (I'm using Maple 7)
|
| Sum((k+1)*ee^k,k = 3 .. infinity). This should converge for
| abs(ee)<1. We know that the sum from 0 to infinity equals in that
| case 1/(1-ee)^2 which is checked by maple:
|
| > sum((k+1)*(ee)^k,k=0..infinity);
| 1/((ee-1)^2)
|
| (no convergence check b.t.w.)
|
| If we plug in ee=-0.5 we obtain:
| > subs(ee=-0.5,%);
| 0.4444444
|
| Now Sum((k+1)*ee^k,k = 3 .. infinity) should be Sum((k+1)*ee^k,k = 0
| .. infinity) - Sum((k+1)*ee^k,k = 0 .. 2), right? This we can
| calculate for the case ee=-0.5 to be equal to 0.4444444-0.75=
| -.3055555556. But here the surprise: if we use maple to calculate the
| sum from 3 to infinity with arbitrary value of ee first and then
| substitute ee=-0.5 we get:
| > sum((k+1)*(ee)^k,k=3..infinity);
| 4*ee^3*(-9/ee^(1/2)/(-ee+1)^2*LegendreP(1,-3,(ee+1)/(-ee+1))-3/2*1/(ee-1)^5*(-ee+1)^2/ee+1/(ee-1)^5*(-ee+1)^2/ee^2-1/4*1/(ee-1)^5*(-ee+1)^2/ee^3-1/4*1/ee^3*(-ee+1))
|
| > evalf(subs(ee=-0.5,%));
| -.1666666667-0.*I
|
| which is clearly different from the expected result. I assume that
| already the expression with the associated Legendre functions is wrong
| but I'm not sure. We get the expected result though if we take the
| limit:
| > sum((k+1)*(ee)^k,k=3..n);
| ee^(n+1)*(-2+(n+1)*ee-n)/(ee-1)^2-ee^3*(-4+3*ee)/(ee-1)^2
|
| >limit(subs(ee=-0.5,%),n=infinity);
| -.3055555556
|
|
Previous by date: [MUG] Re: Precise and invariant timing of a Maple program, Maple User Group
Next by date: [MUG] RE: DLL, Alec Mihailovs
Previous thread: [MUG] Numerical solution of ODE, PierLuigi Zezza
Next thread: [MUG] DLL, Bguerrieri
|