Ticket #10914 (closed defect: fixed)

Opened 2 years ago

Last modified 13 months ago

Integration involving abs gives wrong result

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

Description (last modified by kcrisman) (diff)

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 Download.

Attachments

trac_10914.patch Download (916 bytes) - added by kcrisman 13 months ago.
Apply this patch only

Change History

comment:1 Changed 2 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 2 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 13 months ago by mjo

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

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

comment:4 Changed 13 months ago by kcrisman

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

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 13 months ago by kcrisman

Apply this patch only

comment:5 Changed 13 months ago by kcrisman

  • Description modified (diff)

comment:6 Changed 13 months 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 13 months ago by jdemeyer

  • Milestone set to sage-5.0

comment:8 Changed 13 months ago by jdemeyer

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