Opened 2 years ago

Last modified 5 weeks ago

#26563 needs_review defect

Sage screws up the integration of some functions.

Reported by: charpent Owned by:
Priority: major Milestone: sage-8.5
Component: symbolics Keywords: integration, abs_integrate
Cc: mforets, chapoton Merged in:
Authors: Michael Orlitzky Reviewers:
Report Upstream: N/A Work issues:
Branch: u/mjo/ticket/26563 (Commits) Commit: 117fb428cb898d479383a381fff302ba4848a43f
Dependencies: Stopgaps:

Description (last modified by charpent)

Inspiration this ask.sagemath question.Edit: this one seems to be another instance of the same problem.

A lot of tickets describe indefinite integral bugs attributable to maxima, most notably its abs_integrate package ; see #12731 for a sample of the latter, and the list of integration tickets for somother infamous examples...

However, Sage, which is becoming a mature system, seems to have become able to screw up things by itself on its own, without any external help. Case in point :

sage: elliptic_e(x,1/2).diff(x)
sqrt(-1/2*sin(x)^2 + 1)
  • Maxima can't solve the reverse problem, but will honestly report its failure :
    sage: maxima.integrate(sqrt(1-m*sin(x)^2),x).sage()
    integrate(sqrt(-m*sin(x)^2 + 1), x)
    
    
  • Sage will lie ;-) :
    sage: integrate(sqrt(1-m*sin(x)^2),x)
    1/4*m*x - 1/8*m*sin(2*x)
    

which is wrong, wrong, wrong...

Change History (6)

comment:1 Changed 2 years ago by mantepse

I think that this actually is due to abs_integrate:

(%i1) integrate(sqrt(1-m*sin(x)^2),x);
                           /
                           [               2
(%o1)                      I sqrt(1 - m sin (x)) dx
                           ]
                           /
(%i2) load(abs_integrate);
ARRSTORE: use_fast_arrays=false; allocate a new property hash table for $INTABLE2
(%o2) sage-develop/local/share/maxima/5.41.0/share/contrib/integration/abs_integrate.mac
(%i3) integrate(sqrt(1-m*sin(x)^2),x);
                    2 m sin(2 x) false - m sin(2 x) + 2 m x
(%o3)               ---------------------------------------
                                       8

(although it's quite interesting what sage does with the result...)

comment:2 Changed 2 years ago by mforets

  • Cc mforets added

comment:3 Changed 2 years ago by charpent

  • Description modified (diff)

comment:4 Changed 20 months ago by chapoton

  • Keywords abs_integrate added

comment:5 Changed 19 months ago by chapoton

fixed by #27958, that needs review

comment:6 Changed 5 weeks ago by mjo

  • Authors set to Michael Orlitzky
  • Branch set to u/mjo/ticket/26563
  • Cc chapoton added
  • Commit set to 117fb428cb898d479383a381fff302ba4848a43f
  • Status changed from new to needs_review

New commits:

117fb42Trac #26563: check the fundamental theorem of calculus for elliptic_e().
Note: See TracTickets for help on using tickets.