Opened 4 years ago

Last modified 7 days ago

#17511 new defect

Get integral of abs(sin(x)) and abs(cos(x)) right

Reported by: kcrisman Owned by:
Priority: major Milestone: sage-6.5
Component: calculus Keywords: abs_integrate
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Reported upstream. Developers acknowledge bug. Work issues:
Branch: Commit:
Dependencies: Stopgaps: #12731

Description (last modified by kcrisman)

See this comment, discussion in #13364, the supposed fix at https://sourceforge.net/p/maxima/bugs/2520/, this ask.sagemath question, and so forth.

E.g. this is annoying (but apparently right)

(%i1) load(abs_integrate);
(%i3) display2d:false;

(%o3) false
(%i4) integrate(abs(sin(x)),x);

(%o4) 4*(abs(sin(x))*(atan(sin(x)/(cos(x)+1))/2
                     +sin(x)/((cos(x)+1)*(2*sin(x)^2/(cos(x)+1)^2+2)))
        /abs(cos(x)+1)
        -(signum(1/(cos(x)+1))*signum(sin(x))*log(2*sin(x)^2/(cos(x)+1)^2+2)
         -signum(1/(cos(x)+1))*signum(sin(x))*log(sin(x)^2/(cos(x)+1)^2+1)
         +signum(1/(cos(x)+1))*signum(sin(x))
                              *(2*sin(x)*atan(sin(x)/(cos(x)+1))/(cos(x)+1)
                               -log(2)))
         /4)

but it doesn't do the definite integral at all, even the easy ones where abs does nothing on the interval!

Change History (6)

comment:1 Changed 4 years ago by kcrisman

Worse,

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

comment:2 Changed 4 years ago by kcrisman

  • Report Upstream changed from Not yet reported upstream; Will do shortly. to Reported upstream. Developers acknowledge bug.

comment:3 Changed 4 years ago by kcrisman

  • Description modified (diff)

comment:4 Changed 4 years ago by jakobkroeker

  • Stopgaps set to #12731

comment:6 Changed 7 days ago by chapoton

  • Keywords abs_integrate added
Note: See TracTickets for help on using tickets.