So, this is what I'm actually trying to integrate:

  sage: n(integrate(x * sgn(x^2 - 1/4), x, -1, 0))
  0.500000000000000

But, the function within sgn() has only one root on (-1, 0),

  sage: (x^2 - 1/4).roots()
  [(-1/2, 1), (1/2, 1)]

We can check the value of sgn() on both subintervals:

  sage: sgn(x^2 - 1/4)(x = -0.75)
  1

  sage: sgn(x^2 - 1/4)(x = -0.25)
  -1

So that first integral should be equal to the sum of the following,

  sage: n(integrate(x, x, -1, -0.5))
  -0.375000000000000

  sage: n(integrate(-x, x, -0.5, 0))
  0.125000000000000

So it looks like integrate or sgn is getting confused, unless I n()ed
too early or missed a cast somewhere.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to