As we are looking for the perimeter of the polygon, we should understand the formula for each figure. For #2, we can clearly see that we have a square, which concludes that the perimeter for the figure is going to be 4S ('S' being the length of one side as all sides are equal).
Let's apply this to our problem. P = 4S; S = 6x + 3; set this up as an equation.
P = 4(6x + 3); apply the distributive property to the right side of the equation. P = 4(6x) + 4(3); P = 24x + 12
As we can see above, the perimeter of the square in problem #2 is going to be 24x + 12.