You have that the perimeter of the rectangle is given by the following formula:
[tex]P=2l\text{ + 2w}[/tex]l: length of the rectangle
w: width of the rectangle
[tex]\begin{gathered} l=3x^2+x+2 \\ w=-x^2-5x+1 \end{gathered}[/tex]Then, you replace the pevious expression for l and w in the formula for the perimeter, just as follow:
[tex]\begin{gathered} P=2(3x^2+x+2)+2(-x^2-5x+1) \\ P=2(3x^2)+2(x)+2(2)+2(-x^2)+2(-5x)+2(1) \\ P=6x^2+2x+4-2x^2-10x+2 \\ P=4x^2-8x+6 \end{gathered}[/tex]Hence, the perimeter of the rectangle is P = 4x2 - 8x + 6