Find two positive real numbers such that the sum of the first number and the second number is 42 and their product is a maximum.

x+y = 42

p = xy = x(42-x)
you know that the vertex of a parabola (the maximum, in this case) is midway between the roots. So, x=y=21

Also, you recall that the area of a rectangle with a given perimeter is maximum when it is a square.