Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

var constructs symbolic ring (SR) variables:

sage: var('x')
sage: sin(x)
sage: x in SR
sage: x.parent()
Symbolic Ring

Polynomial rings are much better at working with polynomials, but nothing else:

sage: R.<x> = QQ[]
sage: x in PolynomialRing(QQ,1,'x')
sage: x.parent()
Univariate Polynomial Ring in x over Rational Field

Using a polynomial variable in a non-polynomial manner automatically converts it to the symbolic ring:

sage: type(x)
<type 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'>
sage: type(sin(x))
<type 'sage.symbolic.expression.Expression'>