This is an artifact from Mateusz's polys11, which I am merged into. There are some other bugs from that branch that you might run into, such as if you try using a ground type other than gmpy or a python other than 2.7. Basically, he made some changes to the domains that aren't quite ready yet, but I had to merge into his branch anyway because of a serious bug that was fixed there.
By the way, why do you install the package? There is no need to do that. Just run ./bin/isympy from the sympy directory. Aaron Meurer On Aug 19, 2010, at 10:39 AM, Christian Muise wrote: > I'm having issues with the branch: > > >>> from sympy import * > Traceback (most recent call last): > File "<input>", line 1, in <module> > File "/usr/local/lib/python2.6/dist-packages/sympy/__init__.py", line 24, > in <module> > from polys import * > File "/usr/local/lib/python2.6/dist-packages/sympy/polys/__init__.py", line > 3, in <module> > from polytools import ( > File "/usr/local/lib/python2.6/dist-packages/sympy/polys/polytools.py", > line 66, in <module> > from sympy.polys.domains import FF, QQ > ImportError: No module named domains > >>> > > I guess it's the version I'm using? Python 2.6.5 is installed. > > On Wed, Aug 18, 2010 at 11:43 PM, Aaron S. Meurer <asmeu...@gmail.com> wrote: > So a few words. First, if you just pass it a strictly rational function, it > is nothing new. It will return the exact same result as integrate() because > it uses the exact same function, which is the already existing ratint() > (however, there is a fix in my branch for rational functions with symbolic > coefficients that fail in master). > > To really test this, you need to pass it a function that has exp and/or log > in it. For example, here are some functions that you might try that better > test the algorithm: > > In [2]: risch_integrate(1/(exp(x)**9 + 1), x) > Out[2]: > ⎛ 9⋅x⎞ > log⎝1 + ℯ ⎠ > x - ───────────── > 9 > > (your example with x replaced with exp(x)) > > In [18]: risch_integrate(diff(exp(x)*log(x)/(x + 1), x), x) > Out[18]: > x > ℯ ⋅log(x) > ───────── > 1 + x > > This seems to be a simple example, but observe that our current integrate() > cannot handle it: > > In [19]: integrate(diff(exp(x)*log(x)/(x + 1), x), x) > Out[19]: > ⌠ > ⎮ ⎛ x x x ⎞ > ⎮ ⎜ℯ ⋅log(x) ℯ ⋅log(x) ℯ ⎟ > ⎮ ⎜───────── - ───────── + ─────────⎟ dx > ⎮ ⎜ 1 + x 2 x⋅(1 + x)⎟ > ⎮ ⎝ (1 + x) ⎠ > ⌡ > > Also, it's fun to pass it functions that you know do not have elementary > anti-derivatives, to see if it can verify that fact: > > In [20]: risch_integrate(exp(x**2), x) > Out[20]: > ⌠ > ⎮ ⎛ 2⎞ > ⎮ ⎝x ⎠ > ⎮ ℯ dx > ⌡ > > In [21]: risch_integrate(1/log(x), x) > Out[21]: > ⌠ > ⎮ 1 > ⎮ ────── dx > ⎮ log(x) > ⌡ > > Also, remember what I said about integrating random functions. If you try to > integrate a random function, the chances are pretty good that it will not be > elementary, and even if it is, the result could be quite complicated and it > could take a long time to compute. Much better is to come up with an > expression that is as complex or not complex as you like, then differentiate > it and see if risch_integrate() can give you the original thing back again. > > On Aug 18, 2010, at 9:05 PM, Ondrej Certik wrote: > > > Hi Aaron! > > > > On Thu, Aug 5, 2010 at 2:01 PM, Aaron S. Meurer <asmeu...@gmail.com> wrote: > >> (copied from issue 2010) > >> > >> I have ready in my integration3 branch a prototype risch_integrate() > >> function, that is a user-level function for the full Risch Algorithm I > >> have been implementing this summer. Pull from > >> http://github.com/asmeurer/sympy/tree/integration3 > > > > This is just excellent! > > > > I would like to invite everyone to try this. (Read Aaron's email above > > for things to try and not to try yet.) So here are some tougher cases: > > > > In [1]: risch_integrate(1/(x**8+1), x) > > [hangs] > > This is our old friend expand() again (if you break anything that hangs in > sympy these days, it usually ends up being in expand in the traceback). I am > hoping that Mateusz's continual Poly improvements will make this go away > eventually. > > > > > > > In [4]: cancel(risch_integrate(1/(x**9+1), x).diff(x)) > > Out[4]: > > d ⎛ ⎛ 6 3 ⎞⎞ 3 d ⎛ > > 1 + 3⋅──⎝RootSum⎝531441⋅t + 729⋅t + 1, Λ(t, t⋅log(x + 9⋅t))⎠⎠ + 3⋅x > > ⋅──⎝Root > > dx dx > > ────────────────────────────────────────────────────────────────────────────── > > 3 > > 3 + 3⋅x > > > > ⎛ 6 3 ⎞⎞ > > Sum⎝531441⋅t + 729⋅t + 1, Λ(t, t⋅log(x + 9⋅t))⎠⎠ > > > > ────────────────────────────────────────────────── > > > > > > It should be equivalent but it's a bit messy. Maybe we need to > > implement some symbolic manipulation of RootSum(). > > Mateusz should look at this. > > > > > In [18]: risch_integrate(sqrt(1+exp(x)), x) > > NotImplementedError: Couldn't find an elementary transcendental > > extension for (1 + exp(x))**(1/2). Try using a manual extension with > > the extension flag. > > No, and it won't be any time soon. The algorithm I am implementing is only > the transcendental case (no algebraic functions like sqrt). Now, the > algebraic part does exist, but it is much more difficult to implement, and I > won't even start to do it until the transcendental case is finished. If you > get the above error, and you believe that the function is really not > algebraic, please post it here because it could be a bug in my preparser > algorithm, (be aware that you could be wrong, though). > > > > > > > [18] is probably not supported yet. > > > > > > Otherwise it works great. I wasn't able to make it break. > > Well, I know it's possible, because I do it all the time (and then I go and > fix the bug). > > > > > > > Ondrej > > Aaron Meurer > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sy...@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sy...@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.