# Substitution of polynomial powers

Hi,

I would like to make a "square root" substitution in a particular multivariate polynomial to obtain another multivariate polynomial. For instance, if I have

`f(x,y) = x^2 + x^4 y + y^3 + 1`

and want to replace `x^2`

with `u`

, then the resulting polynomial should be
`g(u,y) = u + u^2 y + y^3 + 1`

. I tried using subs but didn't work properly. Any ideas how to do this in sage?