#11590: Integrating the sgn() function can produce incorrect results
------------------------+---------------------------------------------------
   Reporter:  mjo       |          Owner:  burcin                               
         
       Type:  defect    |         Status:  new                                  
         
   Priority:  major     |      Milestone:                                       
         
  Component:  calculus  |       Keywords:                                       
         
Work_issues:            |       Upstream:  Reported upstream. Developers 
acknowledge bug.
   Reviewer:            |         Author:                                       
         
     Merged:            |   Dependencies:                                       
         
------------------------+---------------------------------------------------

Comment(by mjo):

 I'm stumped on this one. We get the correct antiderivative:

 {{{
 sage: integrate(x*sgn(x^2-1/4),x)
 1/2*abs(x^2 - 1/4)
 }}}

 And ECL gives us the right answer, so it's not an environment setting:

 {{{
 sage: from sage.interfaces.maxima_lib import ecl_eval
 sage: ecl_eval("#$'integrate(x*signum(x^2-1/4),x,-1,0);$")
 <ECL: ((RAT SIMP) -1 4)>
 }}}

 But going through `maxima_eval` is still trouble:

 {{{
 sage: integrate(x*sgn(x^2-1/4),x,-1,0)
 1/2
 sage: from sage.interfaces.maxima_lib import maxima_eval
 sage: a = '($INTEGRATE ((MTIMES SIMP) $X ((%SIGNUM SIMP) ((MPLUS SIMP)
 ((RAT SIMP) (- 1) 4) ((MEXPT SIMP) $X 2))) ) $X -1 0)'
 sage: maxima_eval(a)
 <ECL: ((RAT SIMP) 1 2)>
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11590#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to