Comment #3 on issue 2010 by asmeurer: Integration with the full Risch Algorithm
http://code.google.com/p/sympy/issues/detail?id=2010

Here we can see the trade-off: heuristic Risch algorithm is simple to implement and can handle lots of special cases, but can't prove anything; on contrary Risch algorithm can prove that a function has (or not)
an elementary integral, but is very complex and hard to implement.

Also, as you can see from the timings above, the full algorithm is *way* faster than the heuristic. It's easy to see why this is. The full algorithm integrates directly, but the heurisch tries to build a candidate integral , which is necessarily quite complex, and solves an often enormous system of linear equations to solve for the coefficients. Originally, I was going to use the heurisch as a fast preprocessor to the full algorithm as Bronstein suggests, but now I think I am going to use it only as a fallback (because it can handle some algebraic integrals).

Of course, the fact that the full algorithm is using Poly everywhere helps too :)

I think that adding NonElementaryIntegral class would be sufficient. It would inherit from Integral class, but have noop _eval_integral(). There would be also additional classes for special cases, e.g. logarithmic or sine
integrals (special pretty printing etc.).

Yes, I've though about either adding a subclass NonElementaryIntegral, or else adding an attribute Integral.has_elementary_integral, which would True, False, or None (None for when it can't say, such as an algebraic integrand). Also to consider is that you might want only an elementary integral, or you might want special functions. So

integrate(2*exp(-x**2)/sqrt(pi), x)

would return erf(x), but

integrate(2*exp(-x**2)/sqrt(pi), x, elementary=True)

would return NonElementaryIntegral(2*exp(-x**2)/sqrt(pi), x). And do you think NonElementaryIntegral should be pretty-printed any differently, so that people can recognize it? It seems to me that it should, but maybe it's just because I'm so excited about the algorithm being able to prove that integrals are non-elementary.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to