# Revision history [back]

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

 3 retagged tmonteil 24733 ●29 ●176 ●460 http://wiki.sagemath.o...

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