Neither of the two examples work. You forgot to declare x to also be a polynomial ring variable. By default, x is a symbolic ring variable:
sage: R.<a, b> = QQ[] sage: f = x^2 + a*x + b sage: f.parent() Symbolic Ring sage: a.parent(), b.parent(), x.parent() (Multivariate Polynomial Ring in a, b over Rational Field, Multivariate Polynomial Ring in a, b over Rational Field, Symbolic Ring) If you also declare x as a polynomial ring variable then everything works as intended: sage: R.<a, b, c, x> = QQ[] sage: f = x^3 + a*x^2 + b*x + c sage: f.discriminant(x) a^2*b^2 - 4*a^3*c - 4*b^3 + 18*a*b*c - 27*c^2 On Friday, September 28, 2012 8:10:38 AM UTC+2, [email protected] wrote: > > 1) At > > http://www.math.ucla.edu/~jimc/mathnet_d/sage/reference/sage/rings/polynomial/polynomial_element.html#sage.rings.polynomial.polynomial_element.Polynomial.discriminant > > there is example containing line "f = x^2 + a + b". Should it be "f = x^2 > + a*x + b"? > > 2) How can I compute symbolic discrimant of for example cubic? This works: > > R.<a, b> = QQ[] > f = x^2 + a*x + b > f.discriminant(); > > and this does not: > > R.<a, b, c> = QQ[] > f = x^3 + a*x^2 + b*x + c > f.discriminant(); > > (Again, I remember I was able to do this with Sage -- and now I don't find > it anymore. Arghs!) > > -- > Jori Mᅵntysalo > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support?hl=en.
