Ask Your Question
0

Replacing an expression by another in the ring of polynomials

asked 2024-06-28 18:17:50 +0100

hamouda gravatar image

updated 2024-06-28 18:18:40 +0100

Let $f=xy^2+x+y+z\in\mathbb{Z}[x,y,z]$ I want to replace $xy^2$ by $z$. Is there a single command to do this with using the ring $\mathbb{Z}[x,y,z]$ to get $x+y+2z$. (Without using symbolic variables, I need to use this ring in my situation) ???

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2024-06-28 18:29:16 +0100

Max Alekseyev gravatar image

f % (x*y^2 - z) will do the job:

K.<x,y,z> = ZZ[]
f = x*y^2 + x + y + z
print( f % (x*y^2 - z) )
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2024-06-28 18:17:50 +0100

Seen: 147 times

Last updated: Jun 28