Hi,
For all rectangle having a perimeter constant, the square have the maximum area.
So the rectangle is a square of 10 cm of side.
On other method:
Let assume x le length of the rectangle,(40-2*x)/2=20-x is the width
area=y=x*(20-x)
y=20x-x²
a)
y'=20-2x=0==>x=10 and y=10
b) y=-(x²-2*10*x+100)+100y=100-(x-10)² is maximum if x=10.