In [1]: from sympy import *
In [2]: x=Symbol('x'); integrate(exp(-x**2),x)
Out[2]: Integral(exp(-x**2), x)
I expected erf(x) as result of the integration (times some constant),
but got Integral(exp(-x**2), x) instead. But sympy knows about erf.
This is obvious when I try "integrate(exp(-x**2)*erf(x), x)". Why is
erf not recognized as integral of exp(-x**2)?
Thanks
Benjamin
In [3]: print integrate(exp(-x**2), x)
pi**(1/2)*erf(x)/2
In [4]: print Integral(exp(-x**2), x).doit()
pi**(1/2)*erf(x)/2
This is because Integral represents an unevaluated integral, so it does not evaluate by default (this is what .doit() is for). integrate(), on the other hand, tries to evaluate the integral and only returns an Integral if it cannot do it.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>