## #2242 integrating function with signum incorrect

None
closed
nobody
5
2016-04-14
2011-07-29
Anonymous
No

In Maxima 5.24.0:

(%i11) integrate(x*signum(x^2-1/4),x,-1,0);
1
(%o11) -
2

But the picture makes it pretty clear this should be -1/4.

Is this antideriv ok?

(%i15) integrate(x*signum(x^2-1/4),x);
! 2 1!
!x - -!
! 4!
(%o15) --------
2

This was originally reported at the Sage trac at http://trac.sagemath.org/sage_trac/ticket/11590

## Discussion

• Barton Willis - 2011-07-30

By the way:

Correct antiderivative:

(%i5) 'integrate(x*signum(x^2-1/4),x);
(%o5) abs(x^2-1/4)/2

Correct definite integral

(%i6) 'integrate(x*signum(x^2-1/4),x,-1,0);
(%o6) -1/4

• Comment has been marked as spam.
Undo

You can see all pending comments posted by this user  here

Anonymous - 2011-08-24

Good point, and we're working on getting that loaded in automatically. Doesn't fix the original problem, though.

• Comment has been marked as spam.
Undo

You can see all pending comments posted by this user  here

Anonymous - 2012-02-01

Update: why doesn't regular integrate work? Only 'integrate does.

(%i5) display2d:false;

(%o5) false
(%i6) integrate(x*signum(x^2-1/4),x,-1,0);

(%o6) 1/2
(%i7) 'integrate(x*signum(x^2-1/4),x,-1,0);

(%o7) -1/4

Again, this doesn't fix the problem that the answer is just wrong currently :( but at least would help use get it to work right in Sage.

• Robert Dodier - 2016-04-14
• labels: Lisp Core - Integration --> Lisp Core - Integration, signum
• status: open --> closed
• Group: --> None

• Robert Dodier - 2016-04-14

Fixed by commit 5a300aab, which also fixes related bug #3123.