First time here? Check out the FAQ!

Ask Your Question
1

Polynomial factorization

asked 0 years ago

8moeb8 gravatar image

I have a polynomial in x,y,z such that each term can factor out a certain power of x to get a polynomial with nonzero constant term. I want to simplify this polynomial, so I want to find the largest n such that each term can be divided by x^n and then divide the whole polynomial by x^n. How shall I do it?

Preview: (hide)

Comments

In your story it's not clear to me which polynomial should have a nonzero constant term. Please give an example of the input and the output you want.

rburing gravatar imagerburing ( 0 years ago )

2 Answers

Sort by » oldest newest most voted
1

answered 0 years ago

Emmanuel Charpentier gravatar image

updated 0 years ago

Possible alternative in SR :

sage: var("x, y, z")
(x, y, z)
sage: f = x^2*(x + y + z + 1) + x^3*(y^2 + z^2 + 1); f
(y^2 + z^2 + 1)*x^3 + (x + y + z + 1)*x^2
sage: f.canonicalize_radical().factor()
(x*y^2 + x*z^2 + 2*x + y + z + 1)*x^2

Also :

sage: f.collect_common_factors()
((y^2 + z^2 + 1)*x + x + y + z + 1)*x^2

HTH,

Preview: (hide)
link
1

answered 0 years ago

rburing gravatar image

If I understood you correctly:

sage: R.<x,y,z> = PolynomialRing(QQ)
sage: f = x^2*(x + y + z + 1) + x^3*(y^2 + z^2 + 1); f
x^3*y^2 + x^3*z^2 + 2*x^3 + x^2*y + x^2*z + x^2
sage: g = x^min(e[0] for e in f.exponents()); g
x^2
sage: h = f // g; h
x*y^2 + x*z^2 + 2*x + y + z + 1
sage: f == g*h
True
Preview: (hide)
link

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: 0 years ago

Seen: 209 times

Last updated: Mar 01 '24