#192 new simpsum / taylor bug

None
open
nobody
5
2012-12-14
2002-12-06
Martin Rubey
No

This is a new simpsum / taylor bug. Note that I used a patched version of
Maxima, as described in the simpsum bug thread:

combin.lisp
933,935c927,929
< ;; nil ;; Kratt5 26.11.2002
< ; #-cl
< (let (*a *n (var *var*)) ; freevar expects "var", not "*var*"
---
> nil
> #-cl
> (let (*a *n)

(C1) build_info();

Maxima version: 5.9.0rc3
Maxima build date: 21:0 11/26/2002
host type: i686-pc-linux-gnu
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL-2-5.0

(D1)
(C2)
factsum3(mt,ej):=sum((-1)^(k+1)/(k*mt^k)*sum((1-l)^k-l^k,l,1,ej),k,1,INF)$

(C3) taylor(factsum3(mt,ej),[mt,0,3,ASYMP]);

ej ej ej
==== ==== ====
\ \ \ 3 2
> (- 2 l + 1) > (- 2 l + 1) > (- 2 l + 3 l - 3 l + 1)
/ / /
==== ==== ====
l = 1 l = 1 l = 1
(D3)/T/ ----------------- - ----------------- + -------------------------------
mt 2 3
2 mt 3 mt

+ . . .
(C4) taylor(factsum3(mt,ej),[mt,0,3,ASYMP]),simpsum;

2 2 4 2
l l l + l
(D4)/T/ - -- + ----- - ------- + . . .
mt 2 3
2 mt 6 mt
(C5)

This is nearly correct, only l should be changed to ej...

Martin

Discussion

  • Robert Dodier
    Robert Dodier
    2005-11-24

    • status: open --> closed
     
  • Robert Dodier
    Robert Dodier
    2005-11-24

    Logged In: YES
    user_id=501686

    The reported bug is not present in the current cvs version of
    Maxima.

    Thank you for your report. If you see this bug in a later version
    of Maxima, please submit a new bug report.

     
  • Robert Dodier
    Robert Dodier
    2005-11-25

    Logged In: YES
    user_id=501686

    Reopening this bug report; it was closed by mistake. The
    reported problem is still present in cvs Maxima.

    For the record here is a more readable presentation of the
    same example.

    (%i2)
    factsum3(mt,ej):=sum((-1)^(k+1)/(k*mt^k)*sum((1-l)^k-l^k,l,1,ej),k,1,inf);

    (%o2) factsum3(mt,ej):=sum(
    (-1)^(k+1)/(k*mt^k)*sum((1-l)^k-l^k,l,1,ej),k,1,
    inf)
    (%i3) taylor(factsum3(mt,ej),[mt,0,3,asymp]);

    (%o3) ('sum(-2*l+1,l,1,ej))/mt-('sum(-2*l+1,l,1,ej))/(2*mt^2)
    +('sum(-2*l^3+3*l^2-3*l+1,l,1,ej))
    /(3*mt^3)
    (%i4) ''%, simpsum;

    (%o4) -(6*ej^2*mt^2-3*ej^2*mt+ej^4+ej^2)/(6*mt^3) <-- OK

    (%i5) taylor(factsum3(mt,ej),[mt,0,3,asymp]), simpsum;

    (%o5) -l^2/mt+l^2/(2*mt^2)-(l^4+l^2)/(6*mt^3) <-- OOPS

     
  • Robert Dodier
    Robert Dodier
    2005-11-25

    • status: closed --> open
    • labels: --> 460522
     
  • Robert Dodier
    Robert Dodier
    2006-04-09

    • labels: 460522 --> Lisp Core - Taylor
     
  • Robert Dodier
    Robert Dodier
    2012-12-14

    • Description has changed:

    Diff:

    • milestone: --> None
     
  • Robert Dodier
    Robert Dodier
    2012-12-14

    Still present (5.29.1).

    From what I can tell, if the operation is carried out in two steps it matches the expected result:

    (%i2) factsum3(mt,ej):=sum((-1)^(k+1)/(kmt^k)sum((1-l)^k-l^k,l,1,ej),k,1,inf)$
    (%i3) taylor(factsum3(mt,ej),[mt,0,3,asymp]);
    (%o3) ('sum(-2l+1,l,1,ej))/mt-('sum(-2l+1,l,1,ej))/(2mt^2)
    +('sum(-2
    l^3+3l^2-3l+1,l,1,ej))/(3mt^3)
    (%i4) %, simpsum;
    (%o4) -(6
    ej^2mt^2-3ej^2mt+ej^4+ej^2)/(6mt^3)

    but if you try combining the two steps, you get result observed in the original report:

    (%i5) taylor(factsum3(mt,ej),[mt,0,3,asymp]), simpsum;
    (%o5) -l^2/mt+l^2/(2mt^2)-(l^4+l^2)/(6mt^3)

    The bug only appears if simpsum is enable when taylor is called:

    (%i6) factsum3 (mt, ej), simpsum;
    (%o6) 'sum((-1)^(k+1)('sum((1-l)^k-l^k,l,1,ej))/(kmt^k),k,1,inf)
    (%i7) taylor (%, [mt, 0, 3, asymp]);
    (%o7) ('sum(-2l+1,l,1,ej))/mt-('sum(-2l+1,l,1,ej))/(2mt^2)
    +('sum(-2
    l^3+3l^2-3l+1,l,1,ej))/(3*mt^3)

    (%i9) taylor (%o6, [mt, 0, 3, asymp]), simpsum;
    (%o9) -l^2/mt+l^2/(2mt^2)-(l^4+l^2)/(6mt^3)