On Thu, Oct 22, 2015 at 2:45 AM, Filip <
filip...@gmail.com> 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
> --
> 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
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> 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.