I agree that integrate() shouldn't return things with trivial constants (terms that don't depend on x), but the integrand you shows doesn't do that unless you simplify it. In the expanded form returned by integrate() every term depends on x. Perhaps integrate() can return a nicer looking result here. integrate() generally just returns whatever the internal algorithm gives, without doing any additional simplification.
Aaron Meurer On Tue, Jan 14, 2020 at 2:32 AM Gösta Ljungdahl <gos...@gmail.com> wrote: > > I do not think we have different views on how the mathematics works only > perhaps how to express it. > > I did not say that the antiderivative is unique only that it has a unique > part. That is what I meant by > unique up to a constant but perhaps my English is wrong. > > In your example the unique part is x^2+2*x, no more no less. The general > antiderivative > may be expressed like so: > > x^2+2*x+constant > > ant I'm positive that there is no argument here. > > If we are talking definite integrals we must, however, take the constant to > be 0: > > int_a^b(2*x+2) = b^2+2*b-(a^2+2*a) > > i.e. only the unique part of the antiderivative contributes to the definite > integral and > therefore it is in this case reasonable not to display any constant which is > also > what is commonly done in integral tables. > > I we are talking solutions to differential equations the particular value of > the constant is subject > to initial conditions or more generally expressed: The constant may not be > determined unless > we know the value of the antiderivative for some particular argument. In this > case it would be > downright wrong to set a particular value to it without having this > knowledge. I agree, of course, that > the integral sympy gave me is a possible answer but it also assumes > conditions that I have not > provided so it may be misleading. For reasons outlined I think it would be > better if the > algorithm did wash out the constant. > > Cheers, > Gösta > > > > Den måndag 13 januari 2020 kl. 22:21:10 UTC+1 skrev Oscar: >> >> On Mon, 13 Jan 2020 at 20:52, Josefsson-Ljungdahl <gos...@gmail.com> wrote: >> > >> > Yes, a primitive function is unique only up to a constant but it is not >> > strictly correct to pick out a particular one since the constant is >> > arbitrary. This may be an academic point but I would have thought that it >> > would be possible to construct the algorithm in such a way that a constant >> > is washed out or if included just be named constant or similar and added >> > after to the unique part. >> >> There is no "unique part" though. There is a family of possibilities >> each of which may or may not be representable in a variety of forms. >> Given f = 2x + 2 possible antiderivatives F are x^2 + 2*x or (x + >> 1)^2. These differ by a constant and you can add an arbitrary constant >> to either. So how in general would you identify a unique >> antiderivative? >> >> -- >> 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 on the web visit > https://groups.google.com/d/msgid/sympy/8a7a07c8-4d08-4693-9da2-240b0854291f%40googlegroups.com. -- 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 on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6KW6kN6ozXURmA2H%2BXYBfqsw%2B8LX5P1mnaZgUrwqRBTwg%40mail.gmail.com.