An example of a non-trivial primary polynomial An ideal $I \leq R$ is called primary if $\forall ab\in I$ than either $a\in I$ or $b^n \in I$ for some $n \in \mathbb{N}$. A polynomial $p(x)$ is called primary if the ideal $(p(x)) \leq R[x]$ is primary.
Trivial example: $(x^2) \leq R[x]$ or $(q^n(x)) \leq R[x]$ for an irreducible polynomial $q(x)$, are primary ideals. 
I believe that when $R$ is a field (or even UFD) all primary polynomials are of the form $q^n(x) \in R[x]$ for an irreducible polynomial $q(x)$ due to unique factorization. However, I am concerned with the case where $R=\mathbb{Z}_{p^s}$. Due to some theorem* I know the following should be examples of primary polynomials,
$(x^2+x+1)(x^2+3x+1)$ in $\mathbb{Z}_{2^2}$ or even $(3x+1)(x+1)$ in $\mathbb{Z}_{2^2}$ is supposedly an example.
However, I fail to see why these examples work or with rough terms how can a nontrivial example of a primary polynomial can occur?
*Aforementioned theorem: For $f(x) \in \mathbb{Z}_{p^s}$ if $\overline{f(x)} = g^n(x)$ where $\overline{f(x)} , g(x) \in \mathbb{F}_p(x)$ and $g(x)$ is irreducible then $f(x)$ is primary. (overline denoted the image of f(x) in the quotient $\mathbb{Z}_{p^s}/(p) \cong \mathbb{F}_p$).
 A: Just to take your second example, in $\Bbb Z_4$, we have
$$
(3x+1)(x+1) = (1-x)(1+x) = 1-x^2
$$
This is a non-trivial primary polynomial because it's reducible, and not the power of an irreducible polynomial, but the ideal $(1-x^2)$ is a primary ideal. For instance, $(1-x)(1+x)$ is contained in the ideal, but neither of the factors are in the ideal. However,
$$
(1-x)^4 = 1-2x^2+x^4 = (1-x^2)^2
$$
is an element of the ideal.
A: From the text

$\;\;\;$Atiyah & MacDonald -- Introduction to Commutative Algebra (1969), page 51

we have the following theorem:

$\;\;\;$Let $R$ be a commutative ring with $1$.
  
$\;\;\;$If $I$ is an ideal of $R$ such that $\text{rad}(I)$ is maximal, then $I$ is primary.

Now let $R=\mathbb{Z}_4[x]$.

First, consider the ideal $I=\bigl((3x+1)(x+1)\bigr)$.

To show that $I$ is primary, we can argue as follows . . .

Since $(3x+1)(x+1)=(1-x)(1+x)=1-x^2$ is a non-unit, $I\ne (1)$, hence $\text{rad}(I)\ne (1)$.
$\\[8pt]$
\begin{align*}
\text{Then}\;\;&2^2=0\in I\\[4pt] 
\implies\;&2\in\text{rad}(I)\\[12pt]
\text{so}\;\;&1-x^2\in I\\[4pt]
\implies\;&1-x^2\in\text{rad}(I)\\[4pt]
\implies\;&1-x^2+(2x^2)\in\text{rad}(I)\\[4pt]
\implies\;&1+x^2\in\text{rad}(I)\\[4pt]
\implies\;&1+2x+x^2\in\text{rad}(I)\\[4pt]
\implies\;&(1+x)^2\in\text{rad}(I)\\[4pt]
\implies\;&1+x\in\text{rad}(I)\\[4pt]
\end{align*}
so $(2,1+x)\subseteq \text{rad}(I)$.

But the ideal $(2,1+x)$ is maximal in $R$, since
$$
\mathbb{Z}_4[x]/(2,1+x)\cong \mathbb{Z}_2[x]/(1+x)\cong \mathbb{Z}_2
$$
which is a field.

Thus, $\text{rad}(I)$ is maximal, hence $I$ is primary.

Next, consider the ideal $J=(fg)$, where 
$$
\begin{cases}
f=x^2+x+1\\[4pt]
g=x^2+3x+1=x^2-x+1\\
\end{cases}
$$
To show that $J$ is primary, we can argue as follows . . .

Since $fg=(x^2+x+1)(x^2-x+1)=x^4+x^2+1$ is a non-unit, $J\ne (1)$, hence $\text{rad}(J)\ne (1)$.
$\\[8pt]$
\begin{align*}
\text{Then}\;\;&2^2=0\in J\\[4pt] 
\implies\;&2\in\text{rad}(J)\\[12pt]
\text{Also}\;\;&(f+g)(f-g)=(2x^2+2)(2x)=0\\[4pt]
\implies\;&f^2=g^2\\[4pt]
\implies\;&f^3=fg^2\\[4pt]
\implies\;&f^3\in J\\[4pt]
\implies\;&f\in\text{rad}(J)\\[4pt]
\end{align*}
so $(2,x^2+x+1)\subseteq \text{rad}(J)$.

But the ideal $(2,x^2+x+1)$ is maximal in $R$, since
$$
\mathbb{Z}_4[x]/(2,x^2+x+1)\cong \mathbb{Z}_2[x]/(x^2+x+1)
$$
which is a field.

Thus, $\text{rad}(J)$ is maximal, hence $J$ is primary.
