# Geometry of the derivative and calculus

Four meters of wire is to be used to form a square and a circle. (a) If the square has side length $x$ meters, find an expression for the total area enclosed by the square and the circle.

So for this one $4 = x^2 \Rightarrow x = 2$ but also $4 = \pi r ^2 \Rightarrow 2 = r\sqrt{\pi}$ so $x^2 = \pi r^2$, $x = r\sqrt{\pi}$ but also $x^2$ is the square of the circumference of the circle divided by four. So $x^2 = 2\pi r/4$.

so $2\pi r/4 = \pi r^2$ $r=1/2$ so $x^2 = \pi(1/4)$ This is where I get lost. How do I differentiate form here?

(b) Hence or otherwise, determine how much of the wire should be used for the square and how much should be used for the circle so that the total area enclosed is maximal.

Let us call $S$ the side of the square and $R$ the radius of the circle and $L$ the length of the wire.
So we have $$L=4S+2\pi R$$ Concerning the total area covered by the square and the circle, we have $$A=S^2+\pi R^2$$ Elminating $S$ from the first equation gives $$S=\frac{1}{4} (L-2 \pi R)$$ Replacing in the expression of the area then leads to $$A=\frac{1}{16} (L-2 \pi R)^2+\pi R^2$$ If we want an extremum area, let us compute $$\frac{dA}{dR}=2 \pi R-\frac{1}{4} \pi (L-2 \pi R)$$ and set it equal to $0$. Solve for $R$ and get $$R=\frac{L}{2 (4+\pi )}$$ But the second derivative test says that this is a minimum since $$\frac{d^2A}{dR^2}=2 \pi +\frac{\pi ^2}{2} > 0$$ Now, look again at $\frac{dA}{dR}$; it is always positive, so the area is an increasing function of $R$. So, use all the wire for the circle.