Optimization Shape Question What is the shape of the rectangle that will have the maximum area if a rectangle has a fixed perimeter equal to $S$.
Now, I have no clue how to solve it. I was told to use the area formula and perimeter formula and find the derivative. 
 A: We give a calculus-free proof that is somewhat harder than the calculus proof. Suppose that a rectangle has "length" $a$ and width $b$. Then the perimeter is $2a+2b$. We are told that $2a+2b=S$ Note that 
$$(a+b)^2-(a-b)^2=4ab.$$
If follows that the area $ab$ of  the rectangle is given by
$$ab=\frac{1}{4}(a+b)^2-\frac{1}{4}(a-b)^2=\frac{1}{16}S^2-\frac{1}{4}(a-b)^2.\tag{1}$$
The right-hand side of (1) is biggest if $a-b=0$. So the maximum area is $\frac{1}{16}S^2$. It was achieved by making $a=b$, that is, by using a square.
A: \begin{align}
S&=2l+2w\\
A&=(2l)\times(2w)\\
&=(2l)\times(S-2l)\\
A=f(l)&=(2l)\times(S-2l)\\
\end{align}
What do you do now if you want to optimize the function?

 \begin{align}f^\prime(l)&=2S-8l=0\\S&=4l\\\implies 4l&=2l+2w\\\implies l&=w\\\end{align}

A: $l,m$ - sides of rectangle.
Let's compose the polynomial, which roots can take intermediate values( need to remember Viet's formulas):
$$x^2-(l+m)x+lm=0,$$
$$x^2-\frac{S}{2} x+lm=0,$$
then
$$Square=lm=-x^2+\frac{S}{2},$$
next step is obviously.
