Beginners Question

46 views
Skip to first unread message

ab0c...@gmail.com

unread,
Jul 11, 2014, 1:02:01 PM7/11/14
to sy...@googlegroups.com
Dear user and developers,

I'm new to sympy and tried a few things out, of course I stumbled across smth I coudln't understand.
So here is my question:

If I define an expression like
g=sqrt(a/pi)*exp(-a*x**2)
and integrate it like
integrate(g,(x,-oo,oo))
I get the expected result (1).

But if I integrate an expression like
g=sqrt(1/a/pi)*exp(-x**2/a)
and integrate it the same way I get
( a * sqrt(1/a) ) / sqrt(polar_lift(a))

I must admit I'm a little bit frightened by the polar_lift function because I've never heard of it, but it seems to give the argument of a complex number. Is this correct?
But then I don't understand why for
a=Symbol('a',real=True)
g=sqrt(1/a/pi)*exp(-x**2/a)
simplify(integrate(g,(x,-oo,oo)))
I still don't get 1 as a result.

Would be nice to know.
Thanks in advance.

Ondřej Čertík

unread,
Jul 11, 2014, 1:23:18 PM7/11/14
to sympy
Hi ab0c1d0ef,
Thanks for reporting this, I think you might have discovered a bug.
Btw, this is what I get with the latest master:

https://gist.github.com/certik/cd8cd4c0a7f0ba04c719

But it still shows the behavior you described.

Ondrej

>
> Would be nice to know.
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/b8b2b9f1-596c-416d-a0e9-bb3d17bb6b15%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Aaron Meurer

unread,
Jul 11, 2014, 6:18:57 PM7/11/14
to sy...@googlegroups.com
a needs to be positive for polar_lift to reduce. The result is
correct, but it doesn't reduce to 1 unless a is positive.

I'm not sure what the abs(periodic_argument(1/polar_lift(a), oo)) <=
pi/2 reduces to.

Aaron Meurer
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CADDwiVB580qeT9gmHFGM_ugDssxiWY4cRP9KJVwTV44ppwVaag%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages