# A pig farmer wants to enclose a rectangular area and then divide it into three pens with fencing parallel to one side of the rectangle (see the figure below). There are 940 feet of fencing available to complete the job. What is the largest possible total area of the three pens?

## Why did the pig farmer want to enclose the rectangular area and divide it into three pens? Because he wanted to see pigs doing synchronized swimming, of course! Now let's calculate the largest possible total area.

Let's call the length of the rectangle x and the width y. We have two sides parallel to the length of the rectangle, so the amount of fencing used for those two sides is 2x. We also have three sides parallel to the width of the rectangle, so the amount of fencing used for those three sides is 3y.

According to the problem, we have 940 feet of fencing available, so we can set up the equation:

2x + 3y = 940.

Now, let's solve for y:

3y = 940 - 2x,
y = (940 - 2x)/3.

To maximize the total area, we need to maximize the product of x and y. Let's call the total area A:

A = x * y,
A = x * (940 - 2x)/3.

To find the largest possible total area, we can take the derivative of A with respect to x and set it equal to 0:

dA/dx = (940 - 4x)/3,
940 - 4x = 0,
4x = 940,
x = 235.

Now, substitute x = 235 back into the equation for y:

y = (940 - 2(235))/3,
y = 235.

So, the dimensions of the rectangle that maximize the total area are 235 feet by 235 feet. Now we can calculate the largest possible total area:

A = 235 * 235,
A = 55225 square feet.

Therefore, the largest possible total area of the three pens is 55,225 square feet. That's a lot of space for the pigs to swim and have a grand old time!

## Let's assume the length of the rectangle is L and the width is W.

To enclose the rectangular area, we need to consider the perimeter. The perimeter of the rectangle can be calculated using the formula P = 2L + 2W.

In this case, we have a total of 940 feet of fencing available, so we can say:

2L + 2W = 940

Next, we need to divide the rectangular area into three pens.

Let's say the width of each pen parallel to the length L is x. Therefore, the width of each of the two smaller pens parallel to the width W will be (W - 2x) as the fencing needs to be subtracted from the width.

Hence, the area of each pen can be calculated as A = L * x.

The total area of the three pens can be calculated as A_total = A + A + A = 3A.

To find the largest possible total area of the three pens, we need to maximize the area A.

Since we have the perimeter equation 2L + 2W = 940, we can solve for one variable and substitute it into the area equation.

From 2L + 2W = 940, we can solve for W as:

2W = 940 - 2L
W = (940 - 2L) / 2
W = 470 - L

Substituting this value of W into the area equation, we get:

A = L * x
A = L * (W - 2x)
A = L * (470 - L - 2x)
A = 470L - L^2 - 2Lx

Now, let's express A_total in terms of L and x:

A_total = 3A
A_total = 3(470L - L^2 - 2Lx)
A_total = 1410L - 3L^2 - 6Lx

Now, we have an equation for A_total in terms of L and x. To find the largest possible total area, we need to maximize A_total.

However, we have a constraint of 940 feet of fencing, so we need to consider this constraint while maximizing A_total.

To find the largest possible total area, we can use calculus by taking the derivative of A_total with respect to L (assuming x is a constant):

dA_total/dL = 1410 - 6L - 6x

Setting this derivative equal to zero:

1410 - 6L - 6x = 0

Simplifying:

6L + 6x = 1410

Dividing by 6:

L + x = 235

We can see that L + x = 235, which means L and x need to add up to 235 for the largest possible total area. This suggests that L and x should be as equal as possible.

From the fencing constraint, we know that:

2L + 2W = 940

Substituting L = 235 - x and W = 470 - L, we get:

2(235 - x) + 2(470 - L) = 940

470 - 2x + 940 - 2L = 940

Simplifying:

1410 - 2x - 2L = 940

2x + 2L = 1410

Dividing by 2:

x + L = 705

Since we want L and x to be equal for the largest possible total area, we can solve the system of equations:

L + x = 235
x + L = 705

Adding the equations:

2L + 2x = 940

Dividing by 2:

L + x = 470

Solving this equation, we find:

L = 235 and x = 235

Therefore, the largest possible total area of the three pens is:

A_total = 1410L - 3L^2 - 6Lx
A_total = 1410(235) - 3(235)^2 - 6(235)(235)
A_total = 330,450 - 164,775 - 330,450
A_total = 330,450 - 494,225
A_total = -163,775

Hence, we cannot have a negative total area. This suggests that there is no solution for the given fencing constraint of 940 feet.

## To find the largest possible total area of the three pens, we need to determine the dimensions of the rectangle that maximize the area.

Let's start by representing the dimensions of the rectangle. Let's say the length of the rectangle is denoted by L and the width is denoted by W. Since the fence is parallel to one side of the rectangle, the length L will be divided into four equal segments: the width W and three equal parts for the fencing between the pens.

To calculate the total length of fencing used, we can add up all the sides of the rectangle:
2W + 4L/3 = 940

Simplifying the equation, we have:
2W + 4L/3 = 940
Multiply both sides by 3 to eliminate the fraction:
6W + 4L = 2820

We can rewrite the equation in terms of W:
6W = 2820 - 4L
W = (2820 - 4L) / 6
W = 470 - (2/3)L

Now, let's express the area of the rectangle in terms of W and L:
Area = LW

Substituting the value of W from the previous equation:
Area = L(470 - (2/3)L)
Area = 470L - (2/3)L^2

To find the maximum area, we need to find the vertex of the parabolic function -A(2/3)X^2 + Bx + C.
In our case, A = -(2/3), B = 470, and C = 0.

The x-coordinate of the vertex is given by -B / 2A.
x = -470 / (2 * -(2/3))
x = -470 / (4/3)
x = -470 * 3/4
x = -352.5

Since length (L) cannot be negative, the dimensions of the rectangle cannot be proven with negative lengths.
To get the largest area with positive lengths, we need to find the closest integer to the x-coordinate of the vertex, which is -352.5. Thus, the length is 352.

To find the value of W, we can substitute L = 352 into the equation we obtained earlier for W:
W = 470 - (2/3)L
W = 470 - (2/3) * 352
W = 470 - 234.67
W = 235.33

Since W should also be an integer, let's assume the width W to be 235.

Finally, let's calculate the area of the three pens:
Area_1 = LW = 352 * 235 = 82620
Area_2 = LW = (L/3) * 235 = (352/3) * 235 = 29280
Area_3 = LW = (L/3) * 235 = (352/3) * 235 = 29280

The largest possible total area of the three pens is given by the sum of the three individual areas:
Total Area = Area_1 + Area_2 + Area_3
Total Area = 82620 + 29280 + 29280
Total Area = 141,180 square feet

Therefore, the largest possible total area of the three pens is 141,180 square feet when the dimensions of the rectangle are 352 feet by 235 feet.

## let the length of the large rectangle be y

let each of the parallel divider sides be x
so we have 4x + 2y = 940
2x + y =470
y = 470 - 2x

Area of whole field
= xy
= x(470-2x)
= 470x - 2x^2
d(Area)/dx = 470 - 4x
= 0 for a max of Area
4x = 470
x = 117.5
then y = 235
and the largest area = xy = 117.5(235) = 27612.5 ft^2

If you don't know Calculus, then find the vertex of the downwards opening parabola
Area = -2x^2 + 470x

the x of the vertex is -b/2a = -470/-4 = 117.5
then proceed as above