Opened 3 years ago

Closed 2 years ago

#10914 closed defect (fixed)

Integration involving abs gives wrong result

Reported by: poeschko Owned by: burcin
Priority: major Milestone: sage-5.0
Component: calculus Keywords:
Cc: Merged in: sage-5.0.beta14
Authors: Michael Orlitzky Reviewers: Karl-Dieter Crisman
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by kcrisman)

Running

sage: integrate(abs(sin(x)),(x,0,2*pi))

gives 0, but the correct result is 4.

This happens in version 4.6.1 . In 4.5.3, the integral was not evaluated at all.

Apply trac_10914.patch.

Attachments (1)

trac_10914.patch (916 bytes) - added by kcrisman 2 years ago.
Apply this patch only

Download all attachments as: .zip

Change History (9)

comment:1 Changed 3 years ago by kcrisman

  • Report Upstream changed from N/A to Reported upstream. Little or no feedback.

Certainly the integral better be positive!

This is wrong in Maxima (5.23.2), though it does get the one arch problem correct:

Maxima 5.23.2 http://maxima.sourceforge.net
using Lisp SBCL 1.0.24
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) integrate(abs(sin(x)),x,0,2*%pi);
(%o1)                                  0
(%i2) integrate(sin(x),x,0,%pi/2);
(%o2)                                  1
(%i3) 

This is now Maxima bug 3211915.

comment:2 Changed 3 years ago by kcrisman

  • Report Upstream changed from Reported upstream. Little or no feedback. to Fixed upstream, but not in a stable release.

Apparently that was a dup - see this bug report instead. Fixed, so when we upgrade we'll need a doctest.

comment:3 Changed 2 years ago by mjo

  • Authors set to Michael Orlitzky
  • Report Upstream changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.
  • Status changed from new to needs_review

Well, we don't get 4, but at least the bug is fixed with our current Maxima.

comment:4 Changed 2 years ago by kcrisman

  • Reviewers set to Karl-Dieter Crisman
  • Status changed from needs_review to positive_review

shouln't?

Anyway, this is fine, but the style is a little too informal - those not having read the ticket will be mystified, and shouldn't have to go to the ticket to find out. So I'm uploading the same patch but with slightly different wording.

Notwithstanding that this file doesn't appear to be in the reference manual in any case.

Changed 2 years ago by kcrisman

Apply this patch only

comment:5 Changed 2 years ago by kcrisman

  • Description modified (diff)

comment:6 Changed 2 years ago by mjo

Ah, sorry. I actually parse it now as, "We won't get (an evaluated answer here, which is better than the previous (wrong) answer of zero)," but I don't think it matters much since most of them don't make sense out-of-context, "make sure #xyz is fixed."

comment:7 Changed 2 years ago by jdemeyer

  • Milestone set to sage-5.0

comment:8 Changed 2 years ago by jdemeyer

  • Merged in set to sage-5.0.beta14
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.