# A farmer has 160 feet of fencing to enclose 2 adjacent rectangular pig pens. What dimensions should be used so that the enclosed area will be a maximum?

Jul 19, 2016

I'm assuming that the pig pens have identical dimensions.

#### Explanation:

Let's assume that the pig pens need to be fenced in the way shown in the diagram above.

Then, the perimeter is given by $4 x + 3 y = 160$.

$4 x = 160 - 3 y$

$x = 40 - \frac{3}{4} y$

The area of a rectangle is given by $A = L \times W$, however here we have two rectangles put together, so the total area will be given by $A = 2 \times L \times W$.

$A = 2 \left(40 - \frac{3}{4} y\right) y$

$A = 80 y - \frac{3}{2} {y}^{2}$

Now, let's differentiate this function, with respect to y, to find any critical points on the graph.

$A ' \left(y\right) = 80 - 3 y$

Setting to 0:

$0 = 80 - 3 y$

$- 80 = - 3 y$

$\frac{80}{3} = y$

$x = 40 - \frac{3}{4} \times \frac{80}{3}$

$x = 40 - 20$

$x = 20$

Hence, the dimensions that will give the maximum area are $20$ by $26 \frac{2}{3}$ feet.

A graphical check of the initial function shows that the vertex is at $\left(26 \frac{2}{3} , 1066 \frac{2}{3}\right)$, which represents one of the dimensions that will give the maximum area and the maximum area, respectively.

Hopefully this helps!