Menu

#3237 regression on a simple integral in abs_integrate

None
closed
None
5
2021-11-14
2016-11-06
No

In Maxima 5.35.1, this worked:

(%i1) load("abs_integrate")$
(%i2) integrate(1 / (1 + abs(x-5)), x, -5, 6);
(%o2)                          log(11) + log(2)

in 5.38.1, one gets (both with ECL and with SBCL):

(%i1) load("abs_integrate")$
(%i2) integrate(1 / (1 + abs(x-5)), x, -5, 6);
(%o2) limit   %if(- (x - 5) > 0, - log(6 - x), log(abs(x - 4)))
      x -> 6-
                  - limit     %if(- (x - 5) > 0, - log(6 - x), log(abs(x - 4)))
                    x -> - 5+

Related

Bugs: #3072

Discussion

  • Robert Dodier

    Robert Dodier - 2016-11-08

    The change in behavior appears to be due to commit af38d28 as determined by git bisect.

    Not sure what's going on here. git log says:

    commit af38d28ca56623451bb94db9afb47eb3c405f82a
    Author: Dan Gildea <dgildea>
    Date:   Mon Jan 18 14:53:52 2016 -0500
    
        make orderlessp transitive
    
        fixes bug [#3072]
    
        src/simp.lisp:
        o ordfna: use ordhack consistently whenever we see mplus/mtimes
    
        tests/testsuite.lisp
        o test added for bug [#3072] all pass now
    
     
  • Robert Dodier

    Robert Dodier - 2016-11-30
    • assigned_to: Dan Gildea
     
  • Robert Dodier

    Robert Dodier - 2016-11-30

    Dan, can you take a look at this one? I wasn't able to figure out what's going on.

     
  • Dan Gildea

    Dan Gildea - 2016-12-01

    The change in behavior seems to be caused by a change in the orderlessp order
    of the expressions "x" and "signum(x-5)". Before we had

    (%i14) x*signum(x-5);
    (%o14) x*signum(x-5)
    (%i15) ratsimp(1/(signum(x-5)*x - 5*signum(x-5) + 1));
    (%o15) 1/((x-5)*signum(x-5)+1)
    

    whereas now we have

    (%i11) x*signum(x-5);
    (%o11) signum(x-5)*x
    (%i12) ratsimp(1/(signum(x-5)*x - 5*signum(x-5) + 1));
    (%o12) 1/(signum(x-5)*x-5*signum(x-5)+1)
    

    and abs_integrate does not do well with this more complex expression.
    I think that the current behavior is not technically incorrect, although it is ugly.
    Any further changes to orderlessp should take into account bug [#3072].

     

    Related

    Bugs: #3072

  • Barton Willis

    Barton Willis - 2021-11-14
    • status: open --> closed
     
  • Barton Willis

    Barton Willis - 2021-11-14

    Fixed by [3ca423]. Appended regression test. Closing ticket.

     

    Related

    Commit: [3ca423]


Log in to post a comment.