On Jun 26, 5:07 pm, Loïc <[email protected]> wrote:
> Hello list,
>
> I found a problem with integrate, look at the following sequence:
>
> sage: integrate(sin(x)/(cos(x))^2,x)
> 1/cos(x)
>
> -------- It's ok -----------------
>
> Now I try to add an interval:
>
> sage: integrate(cos(x)/(sin(x))^2,x,pi/6,pi/4)
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (30, 0))
> etc
>
> any idea? Thanks in advance
I got the same errors (at least up to the point you listed them)
running Sage 4.0.2 on 64-bit openSuSE 11.1 with upgraded kernel
2.6.28.2. Looking at the whole gamut of error messages, this,
towards the end, caught my eye:
TypeError: Computation failed since Maxima requested additional
constraints (try the command 'assume(cos(x)>0)' before integral or
limit evaluation, for example):
Is cos(x) positive, negative, or zero?
Just for kicks, I tried following the suggestion of the error message:
sage: assume(cos(x)>0); integrate(sin(x)/(cos(x))^2,x,pi/6,pi/4)
sqrt(2) - 2/3*sqrt(3)
As to why Maxima cannot figure out by itself that cos(x) is
nonnegative in the interval of integration, I don't know. Just for
kicks, I tried the Wolfram Alpha online engine (http://
wolphramalpha.com). The Wolfram Alpha online engine got it right
without additional hints. I entered "integral of sin(x)/cos(x)^2 from
pi/6 to pi/4" without the quotes:
http://www06.wolframalpha.com/input/?i=integral+of+sin(x)%2Fcos(x)^2+from+pi%2F6+to+pi%2F4
Wolfram Alpha even gave a numerical approximation and plotted a
graph! Maybe Maxima makes no effort by itself to figure out if there
are any singularities in the integrand.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---