An integral solved by Mathematica, but not by Sage

68 views
Skip to first unread message

Omri

unread,
Aug 19, 2011, 2:05:35 PM8/19/11
to sage-s...@googlegroups.com
Hi,

I have an integral that is solved by Mathematica, but not by Sage:

integrate( exp(-x^2/2)/sqrt(2*pi) * sign(x-1), x, -oo, oo )

This is actually part of a 3D integral, that mathematica also solves, and sage has problems with due to the lack of multivariate integration:

integrate   sign(x+y)*sign(x+z) ,  where x,y and z are gaussian variables. The result is 1/3.

Does anybody know why this happens, and how can I solve this in Sage?
Thanks,
Omri

kcrisman

unread,
Aug 19, 2011, 2:52:34 PM8/19/11
to sage-support
Maxima can't do this one either, at least not without some package.

(%i8) integrate(%e^(-x^2/2)/sqrt(2*%pi) * signum(x-1),x,minf,inf);

(%o8) ('integrate(%e^-(x^2/2)*signum(x-1),x,minf,inf))/
(sqrt(2)*sqrt(%pi))

Omri

unread,
Aug 20, 2011, 12:45:34 PM8/20/11
to sage-support
So is this an issue that can be resolved?
Omri

kcrisman

unread,
Aug 21, 2011, 12:09:01 AM8/21/11
to sage-support


On Aug 20, 12:45 pm, Omri <omri.ba...@gmail.com> wrote:
> So is this an issue that can be resolved?
> Omri

Depends on what you mean by resolved.

It turns out that the abs_integrate package in Maxima will do this.


(%i1) load(abs_integrate);
STYLE-WARNING: redefining SIMP-ISREAL-P in DEFUN
(%o1) /Users/.../maxima-5.25.0/share/contrib/integrat\
ion/abs_integrate.mac
(%i2) integrate(%e^(-x^2/2)/sqrt(2*%pi) * signum(x-1),x,minf,inf);

(%o2) -erf(1/sqrt(2))


See http://trac.sagemath.org/sage_trac/ticket/11483, where we are
tracking adding this. We tried to add it once, and then apparently
didn't actually do so. Now we still need to do it, which requires the
usual process of review. Thanks for reminding us!

- kcrisman

achrzesz

unread,
Aug 21, 2011, 5:26:59 AM8/21/11
to sage-support
sage: (integrate( exp(-x^2/2)/sqrt(2*pi) * sign(x-1), x, -oo, 1 )
+integrate( exp(-x^2/2)/sqrt(2*pi) * sign(x-1), x, 1,
oo )).simplify_full()

-erf(1/2*sqrt(2))

Omri

unread,
Aug 21, 2011, 11:48:05 PM8/21/11
to sage-s...@googlegroups.com
Thanks - this is exactly what I meant by resolved.
Omri

kcrisman

unread,
Aug 22, 2011, 9:03:57 AM8/22/11
to sage-support
Interesting that this "just works", and I guess it makes sense.
Still, hopefully we'll get #11483 resolved as well soon.
Reply all
Reply to author
Forward
0 new messages