The circle has a circumference of x, so its radius r is given by x=2πr, r=x/(2π).
Its area is πr2=π(x2/(4π2)=x2/(4π).
The side of the square=(30-x)/4.
Its area is ((30-x)/4)2=(30-x)2/16.
Total area of square and circle A=x2/(4π)+(30-x)2/16 (parabola).
A=(16x2+4π(30-x)2)/(64π),
A=(4x2+900π-60πx+πx2)/(16π),
A=(4+π)(x2-60πx/(4+π)+900π/(4+π))/(16π).
Completing the square for x2-60πx/(4+π)+900π/(4+π):
x2-60πx/(4+π)+900π2/(4+π)2-900π2/(4+π)2+900π/(4+π)=
(x-30π/(4+π))2+3600π/(4+π)2. 3600π/(4+π)2 is a positive quantity.
When this square=0 we have a minimum value for the area, and x=30π/(4+π). Other values of x give a positive perfect square which would increase the area because a square is always positive.
x=13.197 approx. [Area=31.506 approx=225/(4+π)].
The side of the square=30-13.197=16.803 approx so the perimeter of the square is 4 times this=67.212 approx.