Explanation:
x = length
y = width
let's assume that a length is beside the river (but we will see that it does not matter).
for 2 variables we need to equations to solve.
one is about the perimeter. we know the perimeter is 120 m.
120 = 2×y + 1×x = x + 2y
therefore,
x = 120 - 2y
and then we have the area we want to maximize :
area = x × y
we use the found identity of the first equation in the second :
area = f(y) = (120 - 2y) × y = 120y - 2y²
the zeros of the first derivative of a function indicate the extreme points of the function.
the sign of the second derivative of that function at these points tells us, if it is a local max. or a min. if the second derivative is positive at the point, then it is a min.
if it is negative, it is a max.
f'(y) = 120 - 4y = 0
4y = 120
y = 120/4 = 30 m
x = 120 - 2y = 120 - 2×30 = 60 m
f''(y) = -4
so,
f''(30) = -4 and therefore negative (it is a max.).
this maximum area is therefore
30×60 = 1800 m²
and so, we see, if we make a width to be a side on the river, we only need to exchange x by y and y by x in all the equations. and we get the same equations with the same numbers and solutions.
it tells us that the side along the river is 60 m long. and the other side type is 30 m long.