Comment #8 on issue 1961 by asmeurer: integration works too hard
http://code.google.com/p/sympy/issues/detail?id=1961

So after working on the algorithm since comment 3, I think it is definitely to an advantage to pull out constant factors. Basically, the factors will not change the answer if they are pulled out first or not, but they can make things more complicated for the algorithm if they are there. For example, if you have sqrt(2) distributed through, it might think it has algebraic coefficients. And if the constant field contains sqrt(-1), then the hypertangent algorithms are not valid anymore and you have to integrate tangents as complex exponentials, which is not only more work, but it gives you an answer in terms of exp(I*x) instead of tan(x). Not to mention that things like symbolic coefficients can just make things like Poly slower, and can potentially screw with other parts of the full Risch Algorithm.

On the other hand, never split apart an Add before sending it to the Risch routines, because it is very possible for a and b to not have elementary antiderivatives, but for a + b to have one (example: x**x and x**x*log(x), simpler example: exp(x**2) and -exp(x**2)).

--
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