Integrating the sgn() function can produce incorrect results
|Reported by:||mjo||Owned by:||burcin|
|Report Upstream:||Reported upstream. Developers acknowledge bug.||Work issues:|
sage: integrate(x * sgn(x^2 - 1/4), x, -1, 0) 1/2
Since the argument to sgn() has only one root, -1/2, on (-1, 0), there are only two subintervals on which sgn() can have different values. In particular,
sage: sgn(x^2 - 1/4)(x = -0.75) 1 sage: sgn(x^2 - 1/4)(x = -0.25) -1
Now, the original, actual result should be equivalent to the sum of the following:
sage: integrate(x, x, -1, -0.5) -0.375 sage: integrate(-x, x, -0.5, 0) 0.125
So, something went wrong during the initial integration.
Change History (17)
comment:2 Changed 4 years ago by kcrisman
- Report Upstream changed from N/A to Reported upstream. Little or no feedback.
comment:3 follow-up: ↓ 13 Changed 4 years ago by kcrisman
- Report Upstream changed from Reported upstream. Little or no feedback. to Reported upstream. Developers acknowledge bug.