Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

substitute x*y by u

Hi there!

I have a polynomial $f(x,y) = xy + x^2y^2 + x*y^2$

I want to substitute $x*y$ instances by a new unknown $u$ (s.t. $u = x * y$)

This is how I proceeded:

# this is the default code
P.<x, y> = PolynomialRing(ZmodN(5))
f = x*y + x^2*y^2 + x*y^2
# now I want to introduce the substitution so I have a f(x,y,u)
new_ring.<x,y,u> = PolynomialRing(ZZ)
ff = f.sub(x*y = u)

Of course this code doesn't work... Any idea what I could do?

substitute x*y by u

Hi there!

I have a polynomial $f(x,y) = xy + x^2y^2 + x*y^2$

I want to substitute $x*y$ instances by a new unknown $u$ (s.t. $u = x * y$)

This is how I proceeded:

# this is the default code
P.<x, y> = PolynomialRing(ZmodN(5))
PolynomialRing(Zmod(5))
f = x*y + x^2*y^2 + x*y^2
# now I want to introduce the substitution so I have a f(x,y,u)
new_ring.<x,y,u> = PolynomialRing(ZZ)
ff = f.sub(x*y = u)

Of course this code doesn't work... Any idea what I could do?

substitute x*y by u

Hi there!

I have a polynomial $f(x,y) = xy + x^2y^2 + x*y^2$

I want to substitute $x*y$ instances by a new unknown $u$ (s.t. $u = x * y$)

This is how I proceeded:

# this is the default code
P.<x, y> = PolynomialRing(Zmod(5))
f = x*y + x^2*y^2 + x*y^2
# now I want to introduce the substitution so I have a f(x,y,u)
new_ring.<x,y,u> = PolynomialRing(ZZ)
ff = f.sub(x*y = u)

Of course this code doesn't work... Any idea what I could do?