Ticket #11483 (closed enhancement: fixed)

Opened 2 years ago

Last modified 5 months ago

enable abs_integrate package from maxima

Reported by: kcrisman Owned by: burcin
Priority: major Milestone: sage-5.0
Component: calculus Keywords:
Cc: burcin, jason Work issues:
Report Upstream: N/A Reviewers: Karl-Dieter Crisman
Authors: Michael Orlitzky, Jason Grout Merged in: sage-5.0.beta3
Dependencies: #12094 Stopgaps:

Description

This is the followup to #8624, as suggested in #10434.

We want to do more integrals! There are lots at the patch at #8624 which it would be great to add.

Attachments

sage-trac-11483.patch Download (6.5 KB) - added by mjo 16 months ago.
Updated patch addressing reviewer comments.

Change History

comment:1 Changed 22 months ago by kcrisman

This would fix #11594.

comment:2 Changed 21 months ago by kcrisman

See  this sage-support thread for another example.

comment:3 Changed 18 months ago by kcrisman

See  this sage-devel discussion for someone working on this!

Also, see #11966 for a newer spkg to base upon.

comment:4 Changed 18 months ago by mjo

  • Dependencies set to #12094

Here's my shot at this. There's one regression (a Maxima bug) that's fixed by Maxima 5.24.0, thus the dependency.

comment:5 Changed 16 months ago by mjo

  • Status changed from new to needs_review

comment:6 Changed 16 months ago by kcrisman

  • Reviewers set to Karl-Dieter Crisman
  • Authors set to Michael Orlitzky

Ok, this looks good, and is the proper way to deal with this. All tests pass.

Should we add Jason as an author due to his work at #8624? Up to him, probably.

comment:7 Changed 16 months ago by kcrisman

  • Status changed from needs_review to needs_work
  • Work issues set to commit message, formatting

Scratch that - Michael, can you update and give a proper commit message etc.? Also, the documentation is incorrectly formatted with double colons etc. - including the zXXX comment, which should have the double colon for EXAMPLES made single and then have a double colon after "subject to change".

Changed 16 months ago by mjo

Updated patch addressing reviewer comments.

comment:8 Changed 16 months ago by mjo

  • Status changed from needs_work to needs_review

That should be a little bit better.

Jason should get author credit too. I unfortunately didn't realize there was a patch at #8624, since it's closed: fixed, until after I had created my patch. Once I saw his, I went back and added some of his doctests to mine.

If he doesn't get author credit, then it looks like I just stole everything =)

comment:9 Changed 16 months ago by kcrisman

  • Status changed from needs_review to positive_review
  • Authors changed from Michael Orlitzky to Michael Orlitzky, Jason Grout

In retrospect, I realize that this file (maxima_lib) isn't even in the reference manual, and it might be nice to have some of these examples in more places (note that x.integrate? is horrible, though it points to a better place). Anyway, this is all fine now.

comment:10 Changed 16 months ago by jdemeyer

  • Work issues commit message, formatting deleted

comment:11 Changed 16 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.0.beta3

comment:12 Changed 5 months ago by dimpase

abs_integrate can't do easy things like integrate(abs(cos(x)),x) right.

(%i8) integrate(abs(cos(x)),x);

log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
(%o8) 2*((1/2-sin(x)/((cos(x)+1)*(sin(x)^2/(cos(x)+1)^2+1)))
        *signum(sin(x)/(cos(x)+1)-1)
        +1)*signum(sin(x)/(cos(x)+1)+1)

and the resulting expression is wrong, as it is 1 at 0, and not 0. As a result, we get integrate(abs(cos(x)),x,0,pi)==-1. Needless to say, same happens in Sage:

sage: integrate(abs(cos(x)),(x,0,pi))
-1

This is with maxima 5.26, as well as with 5.29, see #13364.

Note: See TracTickets for help on using tickets.