Hi,
sage: diff = maxima.diff
sage: diff(x^2 - 3*x +5, x)
2*x - 3
sage: diff(cos(x),x)
-sin(x)
sage: diff(sin(x),x)
cos(x)
So far so good. But now:
sage: diff(tan(x),x)
---------------------------------------------------------------------------
<type 'exceptions.TypeError'> Traceback (most recent
call last)
/home/nea/<ipython console> in <module>()
/usr/local/include/sage-2.4/local/lib/python2.5/site-packages/sage/misc/functional.py
in tan(x)
906 """
907 try: return x.tan()
--> 908 except AttributeError: return RDF(x).tan()
909
910 def transpose(x):
/home/nea/real_double.pyx in
real_double.RealDoubleField_class.__call__()
/home/nea/real_double.pyx in
real_double.RealDoubleElement.__init__()
/home/nea/polynomial_element.pyx in
polynomial_element.Polynomial.__float__()
<type 'exceptions.TypeError'>: cannot coerce nonconstant polynomial
to float
So apparently, sage passes "cos(x)" to diff without evaluation but
it attempts to evaluate "tan(x)" (and fails). Also if I try:
diff( lambda x: sin(x)/cos(x), x )
---------------------------------------------------------------------------
<type 'exceptions.TypeError'> Traceback (most recent
call last)
/home/nea/<ipython console> in <module>()
[... snip longish output]
<type 'exceptions.TypeError'>: unable to coerce element into
maxima
However:
sage: def TAN(x):
....: return sin(x)/cos(x)
....:
sage: diff(TAN(x),x)
sin(x)^2/cos(x)^2 + 1
sage: version()
'SAGE Version 2.4, Release Date: 2007-03-25'
Best,
Nikos
--
A knot and another knot may not be the same knot, though the knot
group of the knot and the other knot's knot group differ not; BUT
if the knot group of a knot is the knot group of the not knotted
knot, the knot is not knotted.
--~--~---------~--~----~------------~-------~--~----~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---