Thanks for helping. I am trying to compute (not numericaly!) the roots
of a quadratic equation build from lagrange_polynomial()...

sage: p2 = SR(-3/4*pi)*x^2 + SR(7/4*pi)*x
sage: p2.roots(x)
[(7/3, 1), (0, 1)]

Now we are back to the original question: Why the following rise a
type error?? I guess that the problem comes from the type of p1, not
being an Expression. So is it possible to cast this p1 to the
Expression class?

sage: SR(-3/4*pi)*x^2 + SR(7/4*pi)*x
sage: basering = PolynomialRing(SR, 'x')
sage: p1 = basering.lagrange_polynomial([(0,0), (1,pi), (2, pi/2)])
sage: p1
-3/4*pi*x^2 + 7/4*pi*x
sage: p1.roots(x)
(...)
TypeError                                 Traceback (most recent call
last)
(...)
TypeError: base_ring must be a ring

-- 
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

Reply via email to