Ask Your Question
0

Is this the correct form of computing "GCD" ?

asked 2013-04-04 06:36:27 -0600

Neda gravatar image

updated 2013-04-04 06:44:11 -0600

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-04 22:25:43 -0600

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 06:36:27 -0600

Seen: 41 times

Last updated: Apr 04 '13