Which of the following polynomials $q(x)$ has the property that $J = q(x)R$? In the ring of polynomials $R = \mathbb{Z}_5[x]$ with coeﬃcients from the ﬁeld $\mathbb{Z}_5$, consider the smallest ideal $J$ containing the polynomials,
$$p_1(x) = x^3 + 4x^2 + 4x + 1$$
$$p_2(x) = x^2 + x + 3$$
Which of the following polynomials $q(x)$ has the property that $J = q(x)R$?
(a) $ q(x) = p_2(x)$
(b) $q(x) = x − 1$
(c) $q(x) = x + 1$  

here $x+1$ is the common factor of the both polynomial.
Does it help anyway?
I could not understand how to proceed.
please help me.
 A: Hint: We will show that $x-1$ is a gcd of our two given polynomials. (Note that $x+1$ is not.)
You can verify that $x-1$ divides both polynomials by verifying that $p_1(1)=p_2(1)=0$. The polynomial $p_2(x)$ factors as $(x-1)(x+2)$, and $-2$ is not a root of $p_1(x)$. So indeed $x-1$ is a gcd of $p_1(x)$ and $p_2(x)$. 
A: By the Factor Theorem $\ x-r\mid f(x)\iff f(r)=0$. Testing the possible factors $\,x\pm1 \,$ we find that $\ \color{#c00}1\,$ is a root both, and $\color{#0a0}{-1}$ only the first. Listing these factors, then $\rm\color{#a2d}{comparing}$ constant terms 
$$\begin{eqnarray} p_1 = x^3\!+4x^2+4x+1 &=& (x-\color{#c00}1)(x\color{#0a0}{+1})(x-a)\ &\color{#a2d}\Rightarrow\ \color{#a2d}{a = 1}\ (= p_1(0))\\
p_2 = x^2+x+3 &=& (x-\color{#c00}1)(x-b)\ &\color{#a2d}\Rightarrow\ \color{#a2d}{b = 3}\ (= p_2(0))\end{eqnarray}$$
Now it is clear that their gcd is $\, \ldots\ $  (note $\,(q) := (p_1,p_2)\,\Rightarrow\, q =\gcd(p_1,p_2),\,$ see below). 
Note $\,(a,b) = (c)\!\iff\! c = \gcd(a,b),\,$ by $\,a,b\in (c)\Rightarrow c\mid a,b\,$ $\Rightarrow$  $\ c\,$ is a common divisor of $\,a,b.\,$  Conversely $\,c \in (a,b)\,$ hence $\, c = j a + k b\,$ hence $\,d\mid a,b\,\Rightarrow\, d\mid ja+kb = c.\,$ Thus we infer from $\,d\mid c\,$ that $\,\deg d \le \deg c,\,$ hence $\,c\,$ is a greatest commond divisor of $\,a,b.\,$  Said more succinctly, linear common divisors are always greatest (where a linear common divisor of $\,a,b\,$ denotes a divisor that is a linear combination of $\,a,b,\,$ i.e. of the form $\, ja+kb\,$ for some $\,j,k\in R).$ 
