A farmer has 25 yards of fencing to make a pig pen. He is going to use the side of the barn as one of the sides of the fence, so he only needs to fence 3 sides. What should be the dimensions of the fence in order to maximize the area?

1 answer

let the side parallel to the barn be y yards
then the other two sides are x yards each

2x + y = 25
y = 25-2x

area = xy
= x(25-2x)
= 25x - 2x^2

which graphs as a downwards parabola, so the vertex has to be found.
quickest way:
the x of the vertex is -b/(2a) = -25/-4 = 6.25
then y = 25-12.5 = 12.5

the fields should be 12.5 long (along the barn) and 6.25 wide