Ask Your Question
0

Is this the correct form of computing "GCD" ?

asked 12 years ago

Neda gravatar image

updated 12 years ago

calc314 gravatar image

Hi

I want to compute the following GCD,

GCD(x^4+x^2+1,x^4-x^2-2*x, x^3 - x^2-4 * x+4 )

I wrote it as

R.< x, y ,z>=PolynomialRing(QQ,3); 
f=x^4+x^2+1;
g=x^4-x^2-2*x;
h=x^3-1;

k= f.gcd(g)
w=k.gcd(h)
w

Is it the correct form? or I should try any other commands?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

vdelecroix gravatar image

Faster way that is documented in the function gcd

sage: R.<x> = PolynomialRing(QQ,'x')
sage: f = x^4+x^2+1
sage: g = x^4-x^2-2*x
sage: h = x^3-1
sage: gcd([f,g,h])
1
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: 12 years ago

Seen: 313 times

Last updated: Apr 05 '13