# Greatest common divisor of two polynomials in $\Bbb Q[X]$

Let $a$ and $b$ be two polynomials in $\mathbb{Q}[X]$, where $$a = X^2+X+1$$ $$b = X - 1$$

Show that the $\gcd(a, b) = 1$.

I use the euclidean algorithm to compute $\gcd(a,b)$, so I have to perform a long division on $a$ with $b$. This yielded

$$a = (X+2)(X-1)+3$$ so $q = (X+2)$, and $r= 3$. Since my remainder is still not equal to $0$, I have to continue, but now I need to compute the $\gcd(b,r) = \gcd(X-1, 3)$.

After applying the long division again, I get a remainder of $0$ and the qoutient being equal to $\frac{1}{3}X - \frac{1}{3}$. Therefore my answer is the last non zero remainder, which is 3. Clearly I am making a mistake somewhere or missing some steps at the end of my calculation.

• $1$ and $3$ are the same when it comes to gcd's. Remember that a gcd of two elements of a ring is only defined up to multiplication by a unit; for example, the gcd of the two integers $6$ and $9$ could be $3$ as well as $-3$. In practice, we usually require the gcd of two integers to be positive, the gcd of two polynomials to be monic, etc., just in order to have a unique answer; but the definition of the gcd in a ring does not define a unique element of the ring. – darij grinberg Sep 6 '17 at 12:52
• Thanks a lot, that reasoning clears up why 3 and 1 are equivalent in this case. – STanja Sep 6 '17 at 13:08
• @STanja As darij, explains, the conventional unit-normalization of gcds in polynomial rings is to force the gcd to be monic by scaling by the inverse of the the leading coefficient. In particular, this normalizes gcds of degree zero to be $1$. – Bill Dubuque Sep 6 '17 at 13:27

Your calculation is correct. In the rational numbers $3$ is a unit (has an inverse) so it's just as good as $1$ for the greatest common divisor.
• Because gcds are defined only up to unit factors (usually one unit-normalizes gcds in polynomial rings over a field by making it monic, i.e. by scaling by the inverse of the lead coef, which normalize constant gcds to be $1)$ – Bill Dubuque Sep 6 '17 at 13:31