It might not be easy to tell whether or not you got a real result back
from e.g. Maxima. The following "works",
sage: f = function('f')(x)
sage: integrate(f,x)
integrate(f(x), x)
sage: _.operator()
integrate
sage: f = function('f')(x)
Rubi should rather be seen as a useful collection of knowledge that can be implemented in different ways. I encourage the Maxima authors to e.g. have a look at Rubi's chapter 1.2.1. They seem to have completely missed that the integral of (a+bx+cx^2)^p, p rational, has a general solution in terms of 2F1.
--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/7OO_VyMC1Ts/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
I think that it might be possible to wrile (in Python ?) a "Ruby rules compiler" that could use our (rudimentary) wildcard facility to effect those substitutions. A possible companion would be a "Mathematica compiler" able to translate a Mathematica Integrate statement and translate it in Sage; in order to test
I tried the thing that makes more semantic sense,
sage: f = function('f',x)
and it told me to
DeprecationWarning... Use function('f')(x) instead.
But it fills my heart with
joy that I can fix things by doing
sage: f(x) = f(x)
sage: f
x |--> f(x)
I have myself implemented symbolic integration in Giac/Xcas in a spirit similar to Maxima or Axiom that is a few dozens *algorithms* for some classes of integrands, then the Risch algorithm in the rational case, like Maxima while it seems that Axiom implements the more general algebraic Risch algorithm. It is completely different from these thousands *rules* (if chapter 1.2.1 is representative of all the rules) : I mean that in an algorithm you compute, and that reduces the number of cases drastically. I'm really not convinced that it is worth adding these kind of rules to Giac/Xcas, but of course I don't speak for other CAS authors.
Back to the original proposal. Certainly rules can't catch all cases either. Doesn't this call for a combined approach? As soon as we have rules in Sage they should be called before the best algorithm we have. The default then IMO should be "special rules + Maxima" instead of Maxima alone.Regards,
Many RUBI rules actually consist on applying that kind of algorithms. The trick with those algorithms is that sometimes they help, and sometimes they hurt (in the sense that you get something that is actually harder to integrate).One of the important things about RUBI that many people forget about is that it not only is able to integrate more expressions than Mathematica/Maple/Maxima... (and usually does it faster), but that it also often produces "better" output (in the sense of more compactexpressions and/or fewer discontinuity problems). In general, each rule of RUBI turns the expression into something simpler, so even if you don't have the full set of rules, you can use the ones you have as a preprocessing step for other kinds of algorithms.
If it makes sense to use integration by parts or not deppends heavily on the actual expression. I suspect that, if you try to make a sane criterion te decide when to apply it, you could end up with something very complicated as well. Ther is reason why there are so many rules in RUBI (although I heard that the author is considering reorganizing them in a decission tree, which might simplify things to some extent).
Other than the academic interest in 'anti-differentiation' it is notclear that this is such an important problem in (say) physics or engineering.Definite integration problems can be done by quadrature programs,and of course the vast majority of symbolic integration problems(from calculus texts) can be done by almost any reasonable computeralgebra system.
It is possible that people interested in this thread would benefit by readingthe PhD theses of Joel Moses, and also James Slagle.Briefly, Moses viewed the problem as 3 stages. A simple algorithm (derivative-divides)which can be written very compactly if you have the right tools.2. a pattern-matching problem, but only about 13 patterns,each attached to an algorithm.3. a kind of Risch-like program (prior to Risch's publications).attaching more patterns and methods to stage 2 would be plausible.Maybe Rubi.implementing a better stage 3 (or calling FriCAS!) would be plausible too.One problem with Rubi "converted" to sympy or Maxima or .... is that(at least in the past) it relied, in non-obvious ways, on Mathematica semantics.This resulted in loops. I have read in and run parts of the Rubi rule-set inMaxima; I think dozens if not hundreds of test cases. But this was years ago.Albert Rich promised, some time ago to (auto-?) write Rubi-as-"if-then-else",for consumption by other systems. Still waiting.Oh, about Slagle.His program, earlier than Moses' viewed integration as an AIproblem involving hill-climbing, breaking up problems into sub-problems,etc.Other than the academic interest in 'anti-differentiation' it is notclear that this is such an important problem in (say) physics or engineering.Definite integration problems can be done by quadrature programs,
and of course the vast majority of symbolic integration problems(from calculus texts) can be done by almost any reasonable computeralgebra system.The more challenging (and fun) stuff is probably apparent to anyonewho has taken a course in complex variables/ conformal mapping/ special functions.I am guess that this is not what most Sage fans have studied.
The problem with Risch "algorithm" is that's not very implementable.No system ever had a complete implementation; it's true that results and implementations by Manuel Bronstein (this is a memorial page, for he died 12 years ago),who authored a lot of results towards making Risch more practical, are most completely represented in Axiom.
I think that if students are using Sage to access the integration program in Maxima, they could justuse Maxima.If they are choosing an integration program based on speed,they must have a very very old computer, since almost any studentproblem is done instantly. By almost any program.Implementing Rubi is certainly feasible. "Converting" the Mathematica codeto python means writing a pattern matching program that parses the Rubicode in python. And figuring out what simplifications are inherent in it.There is already such a pattern matching program in Lisp, so doing itin python is not actually necessary. But maybe someone has doneit anyway. Who can be sure?As I have said before, the objective of most students taking calculusis to pass the course so they never have to know any of this integrationstuff ever again. Thus computer systems are useful primarily tohelp them do homework (cheat?). And for this work, Maxima is probablysufficient.Learning to do symbolic integration "by hand" is a useful test of"can you do algebra". Beyond that, it's not really a vital part ofmost occupations in say, engineering. The only job that Ican think of that really requires knowledge of these methods is"calculus teacher".
As I have said before, the objective of most students taking calculusis to pass the course so they never have to know any of this integrationstuff ever again. Thus computer systems are useful primarily tohelp them do homework (cheat?). And for this work, Maxima is probablysufficient.
Users of integrate() usually don't care which "algorithm" is used,just that the thing is solved. At the moment the default behaviouris calling Maxima only, and you have to know/read that you cantry other algorithms too. Many beginners don't know about this.I propose to make the default "try all algorithms in a specific order".It will return as soon as one library returns a result. An additionaladvantage could be that the fast methods can be used first.Any objections?
If you were teaching calculus, at what point would you wantyour students to take out a smartphone and do integrals?
How much time would you allocate to teaching the syntaxof the CAS, what to do with error messages, how to downloadthe latest copy, etc.?
And what benefit would this be tothe student who may still need to solve problems withouta CAS for a written exam?
Or do we assume that it is no longer necessary to teachmethods of integration, just as it is no longer necessaryto teach how to compute square-roots, or how tointerpolate in a table of logarithms.
Having taught a calculus + computer lab many yearsago (1973! at MIT), the students were more interestedin the Risch algorithm (simple version) than "regular"stuff. Even today, calculus classes don't teach that, do they?
Le vendredi 3 mars 2017 23:20:42 UTC+1, rjf a écrit :If you were teaching calculus, at what point would you wantyour students to take out a smartphone and do integrals?
At least as soon as they are at level n+1 if integration is teached at level n. At level n, make 2 kinds of exam: one with CAS and one without.How much time would you allocate to teaching the syntaxof the CAS, what to do with error messages, how to downloadthe latest copy, etc.?
My own experience with Xcas on a desktop is that it takes less than 1h for 1st year students to be able to do basic CAS stuff (simplify, derive, integrate, plot, etc.) and a little more with CAS calculators. Running Xcas on a smartphone is really straightforward, just open the URL, while installing it locally for an exam takes a few more steps (install an unarchive app, run it and locate the HTML5 page on the device).
Why isn't xcas on Android Play store (so that the installation really goes as it is normally done with Android apps)?
Note that I can run Maxima on Android, and it is installable this way.
Le samedi 4 mars 2017 09:09:17 UTC+1, Dima Pasechnik a écrit :Why isn't xcas on Android Play store (so that the installation really goes as it is normally done with Android apps)?
Because the HTML5 version of Xcas is not an android app. You can run it on any web browser (it's optimized for Firefox) on any device. Much easier for me, I don't have to provide an Android version, an iOS version, and several desktop versions. It's also easy for the user since no installation is required and it's easy to add it to your favorites like any favorite web page. Local install for exams requires a few more steps, once smartphones or tablets are allowed for exams, I'll certainly try to make local install more user-friendly.
Note that I can run Maxima on Android, and it is installable this way.
Maxima on Android is not very user-friendly : the user is assumed to already know Maxima and there is not much help to enter commands (like parenthesis highlighting, syntax coloration, helpers for common commands, ...).
On Saturday, March 4, 2017 at 10:24:19 AM UTC, parisse wrote:
Le samedi 4 mars 2017 09:09:17 UTC+1, Dima Pasechnik a écrit :Why isn't xcas on Android Play store (so that the installation really goes as it is normally done with Android apps)?
Because the HTML5 version of Xcas is not an android app. You can run it on any web browser (it's optimized for Firefox) on any device. Much easier for me, I don't have to provide an Android version, an iOS version, and several desktop versions. It's also easy for the user since no installation is required and it's easy to add it to your favorites like any favorite web page. Local install for exams requires a few more steps, once smartphones or tablets are allowed for exams, I'll certainly try to make local install more user-friendly.hmm, I don't understand - do you mean to say that you can have an android application that provides a serverto be used from android firefox locally, and this is what the local install of xcas on android is doing?
Note that I can run Maxima on Android, and it is installable this way.
Maxima on Android is not very user-friendly : the user is assumed to already know Maxima and there is not much help to enter commands (like parenthesis highlighting, syntax coloration, helpers for common commands, ...).as long as it works, it's better than nothing --- running Maxima in terminal does not provide anything what you listed either.
... Also, Sage often gives solutions that are not as simple as possible, in the sense that they look ugly often. I think this would help with that.
If the main concern is that students don't need integration algorithms so advanced, well, I'm certain there are researchers that do. Clearly Mathematica thinks there are researches that need these algorithms, as they support much more integration than Sage does, which is good enough reason for me to support this for Sage. I don't understand why we would want to be mediocre, it makes sense to be cutting edge.
And, as I said at the beginning of this message, there is ample reason for this integration method to be useful for students too, as it shows the steps to the solution (which is excellent for studying).
... However, I think that this integration method is good as it provides cleaner output and it gives steps to the solution and it is easy to advertise. The fact that it also performs far more integrals than we currently can is also a great bonus.
As far as I can tell, real progress in converting Rubi to python will be possible once it is converted to using binary search instead of pattern matching, right?
...In principle there can be fast progress if the first version only implements general fallback rules like the mentioned 2F1 solutions. Many Rubi rules only specialize 2F1 solutions, a sort of simplify_hypergeometric() if you want. But then, with only the hypergeometric (H) rules the output is ugly as well. You'll get more integrals solved than usual algorithms, however, so this low-hanging fruit would have a place *after eg Maxima returns an unsolved integral.
I think that people who never wrote symbolic integration algorithms underestimate the work required (this is also true in other areas, for example simplification, UI, etc.). I believe that the current symbolic integration implementations are good enough whatever you choose in Maxima, Axiom flavours or Giac. If someone can improve using rubi or something else, that's fine, but I don't believe this will be the reason why the vast majority of people will choose one or another CAS.