Ask Your Question

Revision history [back]

To express the fact that $t=x^2$ you can define a quotient:

sage: R.<x,t> = PolynomialRing(QQ)
sage: p = x^4+x^2+1
sage: Q = R.quotient(x^2-t)
sage: q = Q(p)
sage: q
tbar^2 + tbar + 1
sage: q.parent()
Quotient of Multivariate Polynomial Ring in x, t over Rational Field by the ideal (x^2 - t)

Tu put the result back in the ring R and letting the undeterminate t go to x, you can do:

sage: q.lift()
t^2 + t + 1
sage: q.lift().subs(t=x)
x^2 + x + 1

To express the fact that $t=x^2$ you can define a quotient:

sage: R.<x,t> = PolynomialRing(QQ)
sage: p = x^4+x^2+1
sage: Q = R.quotient(x^2-t)
sage: Q
Quotient of Multivariate Polynomial Ring in x, t over Rational Field by the ideal (x^2 - t)
sage: q = Q(p)
sage: q
tbar^2 + tbar + 1
sage: q.parent()
Quotient of Multivariate Polynomial Ring in x, t over Rational Field by the ideal (x^2 - t)

Tu put the result back in the ring R and letting the undeterminate t go to x, you can do:

sage: q.lift()
t^2 + t + 1
sage: q.lift().subs(t=x)
x^2 + x + 1