bug with integrate

4 views
Skip to first unread message

Loïc

unread,
Jun 26, 2009, 5:07:30 PM6/26/09
to sage-support
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

linuxgus

unread,
Jun 27, 2009, 12:40:12 PM6/27/09
to sage-support
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.


Reply all
Reply to author
Forward
0 new messages