Menu

#3236 bug in simplifying infinite sum with 1st (0th) negative term

None
closed
nobody
5
2016-12-01
2016-11-02
No

the 1st term (for n=0) of sum(1/((n+1)(2n-1)), n, 0,inf) is -1, the rest are positive. However:

(%i42) bfloat(simplify_sum(sum(1/((n+1)*(2*n-1)), n, 1,inf))
  -simplify_sum(sum(1/((n+1)*(2*n-1)), n, 0,inf)));

(%o42)                        1.888888888888889b0

instead of 1.0 (one can also see this symbolically, it outputs an expression off by a rational number).

This is checked with Maxima 5.38.1 complied with SBCL, as well as with ECL.

Discussion

  • Robert Dodier

    Robert Dodier - 2016-11-03
    • labels: --> sum, simplify_sum
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,7 @@
     the 1st term (for n=0) of sum(1/((n+1)*(2*n-1)), n, 0,inf) is -1, the rest are positive. However:
     ~~~
    -(%i42) bfloat(simplify_sum(sum(1/((n+1)*(2*n-1)), n, 1,inf))-simplify_sum(sum(1/((n+1)*(2*n-1)), n, 0,inf)));
    +(%i42) bfloat(simplify_sum(sum(1/((n+1)*(2*n-1)), n, 1,inf))
    +  -simplify_sum(sum(1/((n+1)*(2*n-1)), n, 0,inf)));
    
     (%o42)                        1.888888888888889b0
     ~~~
    
     
  • Robert Dodier

    Robert Dodier - 2016-11-03

    +tags; formatting

     
  • Andrej Vodopivec

    Fixed with commit 989086adeb0b5dd72b3e809edc36a30c976ca3ba

     
    • Dima Pasechnik

      Dima Pasechnik - 2016-11-05

      Thanks.
      Why are you commending out things, rather than removing them?
      (isn't it what git is for, to make such poor man's way of version control unnecessary?)

       
  • Andrej Vodopivec

    • status: open --> closed
     
  • Dima Pasechnik

    Dima Pasechnik - 2016-11-06

    this patch breaks the following (at least on 5.38.1 with ECL):

    simplify_sum(sum(1/((2*n-1)^2*(2*n+1)^2*(2*n+3)^2), n, 0, inf));
    

    which should be 3/256pi^2, and not 3/256pi^2 - 1/32, as I get after the patch is applied.

    Please re-open.

     
  • Dima Pasechnik

    Dima Pasechnik - 2016-11-06

    IMHO, these two examples ought to make it into Maxima's testsuite.

     
  • Andrej Vodopivec

    Both sums are computed correctly after commit 8ec3a05cd24c756f29e0501488be971fe13f7c1f

     
  • kcrisman

    kcrisman - 2016-12-01

    Does this also cover

    (%i11) display2d:false;
    
    (%o11) false
    (%i12) simplify_sum(sum(1/((2*n+1)^2-4)^2, n, 0, inf));
    
    (%o12) (14/3-2*log(2))/64-(2-2*log(2))/64+(%pi^2/2-4)/32
    

    where the answer apparently should be 1/64%pi^2 (see https://ask.sagemath.org/question/35839/sage-incorrectly-evaluates-series/ )?

     
    • Robert Dodier

      Robert Dodier - 2016-12-10

      With current source code, and using Clisp and ECL, I get 1/64*%pi^2 as expected. Are you sure you are getting a different result? If so, is it perhaps an interaction with some flags that Sage is setting?

       
      • Dima Pasechnik

        Dima Pasechnik - 2016-12-11

        I presume Karl-Dieter talks about an old Maxima version (5.35).

         
        • kcrisman

          kcrisman - 2016-12-11

          I hope so, yes! In fact perhaps this commit fixed this bug - I just wasn't able to check.

           

Log in to post a comment.