The total length of the wire is L. Let us use it to make a square of length x and a circle of radius r. The combined area of the shapes is x^2 + pi*r^2. The circumference of the square is 4x and that of the circle is 2*pi*r
4x + 2*pi*r = L
We have to maximize A = x^2 + pi*r^2
Differentiate L and A with respect to r
dA/ dr = 2*x(dx/dr) + 2*pi*r
dL / dr = 4(dx/ dr) + 2*pi
As L is a constant dL/dr = 0
=> 4(dx/ dr) + 2*pi = 0
=> dx / dr = -2*pi/4 = -pi/2
substitute in dA/dr
=> dA/ dr = 2*x(-pi/2) + 2*pi*r
=> dA/dr = -pi*x + 2*pi*r
Take the second derivative with respect to r
=> d^2A / dr^2 = 2*pi – pi*(dx/dr)
=> d^2A / dr^2 = 2*pi + pi^2/2
The second derivative is always positive. The function of A versus r is concave upwards.
In the interval 0 <= 2*pi*r <= L, the function A takes the maximum value at either of r = 0 or r = L or both.
At r = 0, x = L/4, we find A = L^2 / 16
At r = L/2*pi, x = 0, we have A = L^2/ 4*pi
This gives the maximum value of A at r = L/ 2*pi
Therefore we can conclude that for the maximum area the wire should be used only to make the circle and no part of it used for the square.