On Sep 23, 1:37 pm, sps <debernasave...@libero.it> wrote: > And why is it? I do an assignement but it doesn't accept it: > > TypeError: Computation failed since Maxima requested additional > constraints (try the command 'assume((a-1)*(a+1)>0)' before integral > or limit evaluation, for example): > Is (a-1)*(a+1) positive, negative, or zero? > sage: assume((a-1)*(a+1)>0) > sage: integral(cos(t)/(a+cos(t)),t,0,2*pi) > ERROR: An unexpected error occurred while tokenizing input
Unfortunately, Maxima's assumption framework (as discussed elsewhere on the Sage lists currently) is not really that strong, and it turns out that in this case the error message we give you in Sage won't be enough to do it. In general, it isn't possible to anticipate all the possible assumptions one might need, and it's not worth doing it recursively because of what I just said. In this case, I ended up having to answer four different questions to cycle through in Maxima: sage: var('a t') (a, t) sage: assume(a>-1) sage: assume(a>1) sage: assume(sqrt(a^2-1)+a-1>0) sage: assume(abs(sqrt(a^2-1)-a)-1>0) sage: integral(cos(t)/(a+cos(t)),t,0,2*pi) 2*pi Notice that the questions change if you make different assumptions: sage: forget() sage: assume(a>-1) sage: assume(a<1) sage: assume(acos(a)+pi>0) sage: assume(acos(a)-pi>0) sage: integral(cos(t)/(a+cos(t)),t,0,2*pi) ValueError: Integral is divergent. So sometimes even if you *do* have assumptions working properly, there are so many paths in the decision tree that it would be very hard to do this sort of thing. I hope that helps you - I guess to me that is one thing that makes math interesting! - kcrisman -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org