In Maxima it works just fine,
it doesn't seem to be a Maxima problem. Though assume(t,real) is
meaningless,
and the syntax for maxima would be
integrate(t,t, 0, 4*a-a^2) not
integrate(t,0,4*a-a^2).
integrate doesn't care if the lower limit is less than the upper limit.
On Thursday, July 23, 2020 at 4:32:14 PM UTC-7, Dan Swenson wrote:
>
> When I do:
>
> t.integrate(t, 0, 4*a - a^2) # LaTeX: \int_{0}^{4a - a^2} t dt
>
>
> I get the correct answer:
>
> 1/2*a^4 - 4*a^3 + 8*a^2
>
>
> But if I first make some assumptions, then the integral fails to evaluate:
>
> assume(a, 'real')
> assume(a > 1)
> assume(a < 3) # now 0 < a < 4, so 4*a - a^2 > 0
> t.integrate(t, 0, 4*a - a^2) # hangs, eventually produces RuntimeError
>
>
> (To me, the assumptions should make the problem easier, if anything. But
> instead apparently they make it harder...)
>
> I also get a RuntimeError if, under the above assumptions, I do:
>
> bool(4*a - a^2 > 0)
>
>
> So maybe the integrate() function is trying to determine which endpoint
> is greater, and that's causing it to hang? (The top endpoint is greater
> under the given assumptions, but you have to do a bit of algebra to figure
> that out.) Indeed, a workaround is to first do: assume(4*a - a^2 > 0).
>
> I have posted a version of this question at
> https://ask.sagemath.org/question/52382/assumption-seems-to-break-integrate-is-this-a-bug/
>
> , and there user @eric_g suggests another workaround:
> .integrate(algorithm='sympy').
>
> So, does that mean that this is a problem with Maxima?
>
> I noticed the behavior in Sage 8.6, and @eric_g confirms the behavior in
> Sage 9.2.beta5.
>
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-devel/38a665a7-fb9b-4fd1-ab75-2b413b1166ddo%40googlegroups.com.