Answer:
x = 125 ft and y = 250/3 ft
Step-by-step explanation:
Let assume that,
x be the length of the northern part of the fence (parallel to the north wall)
y be the length of the western and eastern pieces of the fence
As well as farmer has $4000 to spend hence we can write,
8x + 8y + 4y = 4000
8x + 12y = 4000
Hence we can say that,
from the above equation we can write

We know that area
A=xy.

we can write

equating it 0 we get


Also,

which is less than zero.
we can see that A''(x) is always less than 0 hence using second derivative test we can say that x = 125 is a maximum point.
now, solving for y we get 
Hence we can say that dimensions for the plot that would enclose the most area is,
x = 125 ft and y = 250/3 ft