Answer:
P = (x - 2) + (12 - x) + (5 + 3x)
=x - 2 + 12 - x + 5 + 3x
=3x + 15
since P = 30,
30 =3x + 15
15 = 3x
5 = x