Ask Your Question
1

Substitution of polynomial powers

asked 2022-10-26 01:54:36 +0100

AbhishekT gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-31 22:06:04 +0100

Max Alekseyev gravatar image

updated 2022-10-31 22:06:43 +0100

There are multiple ways to do so - here are just two options:

1) Via polynomial ideals and reduction:

R.<x,y,u> = PolynomialRing(QQ, order='lex')
f = x^2 + x^4 * y + y^3 + 1
J = ideal([x^2 - u])
g = J.reduce(f)

2) Via symbolic variables/substitution:

var('x y u')
f = x^2 + x^4 * y + y^3 + 1
w = SR.wild(0)
g = f.subs({x^w:u^floor(w/2)*x^(w-2*floor(w/2))})
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

Stats

Asked: 2022-10-26 01:52:02 +0100

Seen: 82 times

Last updated: Oct 31 '22