cant figure out this homework question! I need to use optimisation to find the answer but I cant work it out :(

There is a rectangular garden which is in need of fencing. Three sides of the 30m wide garden are already fenced. You own an additional 20m of suitable fencing and a 1m wide suitable gate. Without moving any of the existing fencing, what is the maximum area you can fence off using straight sections of fence and a corner of the existing fence to make a rectangle.

I believe you would have to input the rule: Area = L X W, somehow. But I don't know how the working would go!
Perhaps you would assume that because there is another 21m of fencing available, that the rectangle was 30m x 21m ??

2 answers

I read this as you are to put the 21m(fence and gate)in one corner, so that the resulting rectange has two sides made up of the original fencing, and two sides totaling 21m. It would be an odd way to build a garden. In that case

area=LW
but L+W=21
area=L(21-L)
darea/dl=0=21-L + L(-1)
or L=21/2
W =21/2

max area= 21^2/4
I think the question means 3 sides of the rectangle are already fenced and you have 21m of extra fencing for the remaining side? :/
But I really have no idea..