# Is this the correct form of computing "GCD" ?

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?