A farmer has 120 meters of wire fencing to make enclosures for his pigs and cows. The rectangular enclosure he is considering will have one side up against a barn (in the center of one side that is 150 meters long, so the enclosure won't require fencing along that edge) and a section of fencing perpendicular to the barn, down the middle of the entire enclosure, to keep the pigs and cows separate.

How should the farmer allocate the fencing to the edges of the enclosure to maximize the area inside? That is, for the maximum area enclosure what should be the length of the side of the rectangle perpendicular to the barn and what should be the length of the side of the rectangle parallel to the barn?

If the length along the bar is x, and the width is y,

x+3y = 150

The area a = xy = (150-3y)y = 3(50y-y^2)
da/dy = 3(50-2y) da/dy=0 when y=25

thus, x = 75

So, the whole area is 75x25

As expected, the area is maximum when the fencing is evenly divided between lengths and widths. For a single fully enclosed area, that would be a square.

To maximize the area inside the enclosure, the farmer needs to allocate the fencing in a way that optimizes the dimensions of the rectangular enclosure. Let's denote the length of the side of the rectangle perpendicular to the barn as x meters, and the length of the side parallel to the barn as y meters.

We know that one side of the enclosure (the barn side) doesn't require any fencing since it will be against the barn, which has a length of 150 meters. This means that the total length of fencing required is:

Length of fencing required = 2x + y

According to the problem, the farmer has a total of 120 meters of wire fencing available. Therefore, we can set up an equation:

2x + y = 120

Since we want to maximize the area inside the enclosure, we need to express the area in terms of x and y.

The area of a rectangle is given by A = length * width. In this case, the width is x, and the length is y - 150 (since there is no fencing needed along the barn side).

So the area inside the enclosure is:

Area = x * (y - 150)

To further simplify the problem, we can express the area in terms of a single variable by solving the equation for y:

y = 120 - 2x

Substituting this into the equation for the area:

Area = x * ((120 - 2x) - 150)
Area = x * (120 - 2x - 150)
Area = -2x^2 + 120x

Now we have the area as a function of a single variable x. To find the maximum area, we need to find the value of x that maximizes the area. To do this, we can find the vertex of the quadratic equation -2x^2 + 120x.

The x-coordinate of the vertex of a quadratic equation in the form ax^2 + bx + c is given by x = -b / (2a). In our case, a = -2 and b = 120.

x = -120 / (2 * -2)
x = 120 / 4
x = 30

So the x-coordinate of the vertex is 30. Substituting this back into the equation for y:

y = 120 - 2 * 30
y = 120 - 60
y = 60

Therefore, to maximize the area inside the enclosure using 120 meters of fencing, the farmer should allocate 30 meters for the side perpendicular to the barn and 60 meters for the side parallel to the barn.