On Thu, Oct 22, 2015 at 2:45 AM, Filip <[email protected]> wrote: > I'm trying to calculate the integral of ln(x-y) dy (with x and y complex) >>> integrate(ln(x-y), y) > but sympy gives me > -x*log(-x + y) + y*log(x - y) - y > If I try to differentiate this wrt. y I get >>> diff(-x*log(-x + y) + y*log(x - y) - y, y) > -x/(-x + y) - y/(x - y) + log(x - y) - 1
If you call simplify() on this you get log(x - y) > which is not exactly equal to ln(x-y). > As far as I know the result of the integration should be -ln(x - y)*(x - y) > + x - y, which also gives the correct result when differentiated in sympy Remember that integrals can differ by a constant. In this case, the argument of one of the logs is negated from what you expect, but this amounts to a complex constant. Aaron Meurer >>> diff(-ln(x-y)*(x-y)+x-y, y) > log(x - y) > > The calculations can be seen as a IPython Notebook here > http://nbviewer.ipython.org/gist/FSund/2a49222b54fa95ccdbc0 > > -- > 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/67936dfa-3e04-4766-9c18-da3a49944115%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/CAKgW%3D6LmQ%3Dh0%2Bsad70W7Rp9wK%3D7%2B2ngxmTk-EuQ5bab%3DuXB1UQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
