Ticket #11445 (closed defect: fixed)
symbolic integration fails on a very simple test case
| Reported by: | pdehaye | Owned by: | burcin |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.0 |
| Component: | calculus | Keywords: | integrate |
| Cc: | kcrisman | Work issues: | |
| Report Upstream: | Fixed upstream, in a later stable release. | Reviewers: | Karl-Dieter Crisman |
| Authors: | Michael Orlitzky | Merged in: | sage-5.0.beta11 |
| Dependencies: | Stopgaps: |
Description
The following happens
sage: var("x")
x
sage: integrate(abs(x - 1) + abs(x + 1) - 2*abs(x), (x,-Infinity,Infinity))
0
sage: integrate(abs(x - 1) + abs(x + 1) - 2*abs(x),(x,-Infinity,10))
2
The second answer is the correct one, of course...
Attachments
Change History
comment:1 Changed 2 years ago by kcrisman
- Cc kcrisman added
- Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.
comment:2 Changed 2 years ago by pdehaye
sure, but certainly something i would hope works! also not sure how much of it is due to the infinite interval and how much due to the function itself
comment:3 Changed 2 years ago by kcrisman
- Report Upstream changed from Not yet reported upstream; Will do shortly. to Reported upstream. Little or no feedback.
This is now reported at this location.
comment:5 Changed 2 years ago by pdehaye
- Report Upstream changed from Reported upstream. Little or no feedback. to Fixed upstream, in a later stable release.
comment:7 Changed 14 months ago by mjo
- Status changed from new to needs_review
- Authors set to Michael Orlitzky
Fixed now that we've got Maxima 5.26.0. Here's a doctest.
comment:8 Changed 14 months ago by kcrisman
- Status changed from needs_review to positive_review
- Reviewers set to Karl-Dieter Crisman
I probably would have put it in sage.symbolic.integration.integral.integral somewhere, where there are lots of tests, but I guess this is fine, and otherwise all is well. I'd hate to have you rebase it to that other location, seems a waste... but then again, that's where they are...
Or what do you think? The problem is that we have no canonical location for integral stuff. integrate? is a wasteland, though it points to better sources of doc.
comment:9 Changed 14 months ago by mjo
I honestly went through the same thought process. At first, I thought, "I'll put it with the Maxima stuff because it was a Maxima bug." But then I thought, what if we ever drop Maxima completely? This isn't a Maxima test: this tests that our integration works. Whatever we would replace Maxima with should also pass this test!
Then, I had to decide whether to put it in functional.py or under symbolics. I settled on this because it's what gets called first when the user calls integrate(). It's also where you're sent if you look up the code with integrate? or integrate??, so to stay true to the report on the ticket, I put it there.
If the reporter had done,
f = abs(x - 1) + abs(x + 1) - 2*abs(x) f.integral(...)
I probably would have stuck it in symbolics. It's no big deal to move it, in any case.
comment:10 Changed 14 months ago by kcrisman
Well, you'll notice that I did give positive review. You are right about the integration tests not belonging in the Maxima docs, of course.
comment:11 Changed 14 months ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed
- Merged in set to sage-5.0.beta11


This also happens in Maxima.
I don't know that I would call this "very simple", though, as integrating absolute value things is somewhat tricky when done symbolically.