Oh, I don't think this is as much of a bug as people think - rjf was
quite wise to ask what my command was!

sage: t=var('t')
sage: sqrt((-m*sin(m*t))^2+(n*cos(n*t))^2).nintegral(x,0,2*pi)

where m, n were determined in an interact.  But I used the wrong
variable in nintegral!  In addition,

sage: t=var('t')
sage: assume(sin(t)^2 + cos(t)^2 > 0)
sage: sqrt((sin(t))^2+(cos(t))^2).nintegral(x,0,2*pi)
Traceback (click to the left for traceback)
...
ValueError: Maxima (via quadpack) cannot compute the integral to that
precision

which seems okay, though no other natural "assume" command got me
there.  Now, perhaps it should still be smarter than this following
example:

sage: t=var('t')
sage: forget()
sage: assume(t==pi/2)
sage: sqrt((-2*sin(2*t))^2+(3*cos(3*t))^2).nintegral(x,0,2*pi)
Traceback (click to the left for traceback)
...
Is  9*cos(3*t)^2+4*sin(2*t)^2  positive or zero?

But at least it's asking the right question, since a numerical
integral is indeed possible here if t=pi/2 and so the integrand is
zero.  And this works:

sage: t=var('t')
sage: forget()
sage: sqrt((-2*sin(2*t))^2+(3*cos(3*t))^2).nintegral(t,0,2*pi)[0]
15.209210627602969


Still, I suppose that it would seem natural to check for the most
common things of this kind like sin^2+cos^2.  Even WeBWorK, a Perl
homework checker, checks for this sort of thing in its (non-CAS-based)
algorithm.

At the very least we know Sage has its work cut out for it if it ever
wants to remove dependence on the slow-slow interface to Maxima and
Lisp issues, because these are (in general) very thorny questions.
Even if they're amusing on occasion!

- kcrisman


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to