Let \( d = \deg (p) \in \mathbb Z^+\).
Note that \(\deg(p\circ p) = d^2\) and \(\deg(x\cdot p + x^2 + 3x + 1) = \max(d + 1, 2)\)
Now we eliminate the case when p(x) is constant to ensure that \(\max(d + 1, 2) = d + 1\).
(Because if p(x) = c, c = cx + x^2 + 3x + 1 for any x, which is impossible.)
Comparing the degrees on both sides gives \(d^2 = d + 1\), which has no solution in \(\mathbb Z^+\).
Therefore, there are no such polynomial p(x) with p(p(x)) = xp(x) + x^2 + 3x + 1.