The legs if an isosceles triangle are (3x^2+4x+2) inches and the base is (4x-5) inches. Find the perimeter of the triangle