AM> Yes, the fallback algorithm in SymPy, heurisch, is very slow. What's AM> the longest time an integral took that still gave an answer from your AM> tests?
Most of the time I used a time-out of one minute, so I cannot tell. But see this comment by Waldek Hebisch: https://groups.google.com/d/msg/sci.math.symbolic/D9W45zQTY3U/O_gH-t-mQiAJ AM> There has been work this summer on improving the Risch algorithm in AM> SymPy to handle trigonometric functions. Unfortunately, none of it is AM> exposed to integrate() yet, because a certain algorithm has to be AM> implemented first (let me know if you are interested in helping out). Unfortunately I have no expertise in this field. AM> And to be fair to SymPy, one of the more advanced algorithms SymPy AM> implements, the Roach Meijer G algorithm, is stronger with integrals AM> involving special functions (either in the integrand or AM> antiderivative), and especially definite integrals, neither of which AM> appear to be represented well in the test suite. There are two test suites. The Charlwood suite and the Timofeev suite. Broadly speaking Charlwood's fifty integrals are the hard ones which test the capability of a CAS to find closed-form solutions, appealing only to the class of real, elementary functions. The Timofeev suite is more general. More or less it covers some cases which every CAS should be able to solve quickly (in less than one minute) and cleanly. This test suite is still under construction and more test cases will be added (see the discussions on sci.math.symbolic). But no claim is raised that the test suites cover the whole range of interesting problems! In fact they developed around the discussion of Albert Rich's Rubi (RUle-Based Integration). It is worth to look this up: http://www.apmaths.uwo.ca/~arich/ AM> I'm also not sure that it's fair that your script calls Piecewise AM> solutions messy. While it's true that they are hard to deal with in AM> simplify(), they are also more correct. [148] Timofeev integrand : 1/(sqrt(x)*(a*x + b)) antideriv : 2*atan(sqrt(a)*sqrt(x)/sqrt(b))/(sqrt(a)*sqrt(b)) sympy : Piecewise((2*I*acosh(sqrt(b)/(sqrt(a)*sqrt(x + b/a)))/(sqrt(a)*sqrt(b)), Abs(b/(a*(x + b/a))) > 1), (-2*asin(sqrt(b)/(sqrt(a)*sqrt(x + b/a)))/(sqrt(a)*sqrt(b)), True)) comment : Solution is messy. comment : Not a real solution! comment : Not a continuous solution! comment : Diffs not back to zero. (Check use of abs.) time : 1.0 Note that the comments are not personal comments but generated by the test routine and are all formally defined and automatically generated. if len(str(solution)) > 2*len(str(antideriv)) print("Solution is messy.") Thus messy thus does not refer to "piecewise"; this is commented by "Not a continuous solution!". Feel free to replace it by some other description. But I do not see anything here which is not "fair". Indeed, the fact that it is not a real solution is perhaps more unfortunate. Both Maple and Mathematica are able to give the real antiderivative. Peter -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
