On Thursday, October 22, 2015 at 4:56:35 PM UTC+3, Filip wrote: > > I'm trying to integrate ln(x-y) dy, but the result I get from SymPy is > very different from Maple's answer. > Here is what I get when I integrate in SymPy: > In [2]: > > integrate(ln(x-y), y) > > Out[2]: > > -x*log(-x + y) + y*log(x - y) - y > > > When I try to differentiate this, i get something very different from > ln(x-y): > In [3]: > > diff(-x*log(-x + y) + y*log(x - y) - y, y) > > Out[3]: > > -x/(-x + y) - y/(x - y) + log(x - y) - 1 > > > Is this a bug in SymPy, or a user error? > > When i differentiate the answer I get when I integrate using Maple, i get > the expected result ln(x-y) > In [4]: > > diff(-ln(x-y)*(x-y)+x-y, y) > > Out[4]: > > log(x - y) > > > An IPython Notebook with an example can be found here: > http://nbviewer.ipython.org/gist/FSund/d3b3f7f590db0e72e2e2 > > I'm using Python 3.4.3 (Anaconda 2.3.0 (64-bit)), and IPython 4.0.0. >
Use cancel to simplify the result. SymPy does not do that automatically. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/53c77412-1e1d-4ead-b094-63ae3d98eebc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
