On Sun, Apr 19, 2009 at 7:44 AM, Maurizio <maurizio.gran...@gmail.com> wrote: > Carl, I took advantage of your suggestion, even though I assume I > can't still go through the whole process with the current gcd > capabilities in Pynac. But before than that, I'd like to point out > something strange I did notice, and maybe also Burcin can help with > that: > > reset() > P.<x,z> = QQ[] > > B = x^3 + x > > var('x, zs', ns = 1) > from sage.symbolic.ring import NSR > Bs = NSR(B) > Bs > x^3 + x > Bs.diff(x) > 0 > > So, the derivative is not working. Which is the cause? It seems that > the "x" in Bs is not the "x" I declared, so the derivative gets 0 as a > result. Which is the reason?
Looks like a bug to me. Burcin, any comments? > Moreover, I don't see this being the right way to do this, because > (for this particular problem: integration) I don't like having the > numerical representation of things like sqrt(5), even if the result is > still correct, so that > > temp = QQbar(sqrt(5)); temp > 2.236067977499790? > > temp^2 > 5.000000000000000? Note that it's only the representation that's numerical; internally these are actually exact numbers. (For instance, if you do "temp^2 == 5" and Sage prints "True", then that means that temp really is exactly the square root of 5.) I use a numeric representation because not all algebraic numbers can be represented with radicals, and solving by radicals is much more difficult than the symbolic-numeric algorithms I used in QQbar. > So, please tell me. Which should be the right way to try to approach > this indefinite integration problem? You can see that I'm not that > good in deep mathematical theory, but approaching the simplest problem > (that could be different from this one I'm looking at right now) is > fun :) Unfortunately, I think the right way is a lot of work. 1) Teach yourself enough math that you can mostly understand the algorithm in the paper. (Not just mechanically follow the steps, but understand what each step does, and have some idea why the algorithm as a whole works.) For some parts of this task, wikipedia and mathworld.wolfram.com will be useful resources (planetmath.org is also interersting); but you'll probably also need to read some books, etc. 2) Implement each missing sub-algorithm in Sage. 3) Implement the entire algorithm in Sage. This sounds glib, but it really is possible... I'm implementing cylindrical algebraic decomposition in Sage following this program. I've been working on it in my spare time for several years; I probably spent a couple of years on step 1, then I started step 2 a couple of years ago, and now I'm working on step 2 and step 3. The problem is that the Risch algorithm just is not simple. A good integration algorithm probably has a couple of phases -- first you try some heuristics, and pattern-match against a database of known integrals; if those fail, then you bring out the big guns and apply the decision procedure. If you're interested in working on integration, maybe you'd rather work on the first phase? That probably requires more computer science and less math than the second phase. Carl --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---