We need to do the product
[tex](x^2+3x+1)\cdot(x^2+x+2)[/tex]
and this is equal to
[tex]\begin{gathered} (x^2\cdot x^2)+(x^2\cdot x)+(x^2\cdot2)+(3x\cdot x^2)+(3x\cdot x)+(3x\cdot2)+(1\cdot x^2)+(1\cdot x)+(1\cdot2) \\ =x^4+x^3+2x^2+3x^3+3x^2+6x+x^2+x+2 \\ =x^4+(x^3+3x^3)+(2x^2+3x^2+x^2)+(6x+x)+2 \\ =x^4+4x^3+6x^2+7x+2 \end{gathered}[/tex]
The answer is
[tex]\begin{equation*} x^4+4x^3+6x^2+7x+2 \end{equation*}[/tex]