# GCD of $f=X^3 +9X^2 +10X +3$ and $g= X^2 -X -2$ in $\mathbb{Z}/5\mathbb{Z}$.

I have to calculate the gcd of $$f=X^3 +9X^2 +10X +3$$ and $$g= X^2 -X -2$$ in $$\mathbb{Q}[X]$$ and $$\mathbb{Z}/5\mathbb{Z}$$.

In $$\mathbb{Q}[X]$$ I got that $$X+1$$ is a gcd and therefore $$r(X+1)$$ since $$\mathbb{Q}$$ is a field.

But I dont know how to do polynomial division in $$\mathbb{Z}/5\mathbb{Z}$$. Can somebody please help me?

Thank you!

• Exactly the same way you did it in $\mathbb{Q}$, except that multiplication of scalars is modulo $5$. $\mathbb{Z}/5\mathbb{Z}$ is also a field. – logarithm May 22 at 15:44

You got the GCD in $$\mathbb Z[X]$$, i.e. $$X+1$$. The GCD in $$\mathbb Z / 5 \mathbb Z[X]$$ is obtained by reducing each coefficient of the GCD in $$\mathbb Z$$ in $$\mathbb Z / 5 \mathbb Z$$.
Which means that the GCD in $$\mathbb Z / 5 \mathbb Z[X]$$ is equal to $$\bar{1}X + \bar{1} = X + \bar{1}$$.
It's easy to see that $$x^2-x-2 = (x+1)(x-2)$$, but in $$\mathbb{Z}/5\mathbb{Z}$$ you have $$5 \equiv 0$$, so $$x^3+9x^2+10x+3 \equiv x^3-x^2+3 = (x+1)\times \ldots$$