Discrete math question... Finding largest area Can anyone help explain to me how to go about solving this question ?:
Of all the rectangles with perimeter 4, prove that the square has the largest area.
I know how to solve this algebraically, although how would one go about solving it in context of discrete mathematics 

Let $x,y$ be the sides of the rectangle and the perimeter be $2s$ 
So, $2(x+y)=2s$
Using algebra,
The area is $xy=x(s-x)=\frac{s^2}4-(x-\frac s2)^2$
As  $(x-\frac s2)^2\ge0,xy\le\frac{s^2}4$
So,the  maximum will be $\frac{s^2}4$ if $x-\frac s2=0\implies x=\frac s2\implies y=s-x=\frac s2=x$

Alternatively using calculus, the ares is $A=xy=x(s-x)=sx-x^2$
So, $\frac{dA}{dx}=s-2x$
For the extreme values of $A,\frac{dA}{dx}=0\implies x=\frac s2$
$\frac{d^2A}{dx^2}=-2<0$
So, $x=\frac s2$ will give us the maximum value of the area $A$.
