Ask Your Question
0

Is this the correct form of computing "GCD" ?

asked 2013-04-04 13:36:27 +0100

Neda gravatar image

updated 2013-04-04 13:44:11 +0100

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-04-05 05:25:43 +0100

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
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: 2013-04-04 13:36:27 +0100

Seen: 276 times

Last updated: Apr 05 '13