Thank you very much for your quick help. At first I was hesitant and tried a few things. Your answer has now convinced me.
Best regards, Andreas Oscar schrieb am Dienstag, 24. Juni 2025 um 12:43:47 UTC+2: > On Tue, 24 Jun 2025 at 11:38, 'Andreas Söll' via sympy > <sy...@googlegroups.com> wrote: > > > > What am I doing wrong? > > > > >>> from sympy import * # Version 1.13.2 > > >>> x = symbols("x") > > >>> f = x / (x+1) > > >>> f > > x/(x + 1) > > >>> integrate(diff(f,x),x) # should be x/(x+1) > > -1/(x + 1) > > > > diff seems correct - what about integrate? > > Antiderivatives are not unique. > > Generally > diff(integrate(f(x), x), x) == f(x) > but we don't necessarily have > integrate(diff(f(x), x), x) == f(x) > because they can differ by a constant of integration: > > >>> cancel(f - integrate(diff(f, x), x)) > 1 > >>> cancel(f - diff(integrate(f, x), x)) > 0 > > -- > Oscar > -- 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+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/sympy/093b9675-5cb6-4b6f-a949-d7d5662d9fd0n%40googlegroups.com.