You plan to build four identical rectangular sheep pens in a row. Each adjacent pair of pens share a fence between them. You have a total of 304304 feet of fence to use. Find the dimension of each pen such that you can enclose the maximum area.
I have figured out the width of each pen (19 ft) but can't seem to get the length and area right
The largest rectangle will have dimensions $x$ and $y$, with area $A=xy$, such that $x\leq y$. The length of fence used is $L=5x+2y$ (It is evident that the longer edge should not be used as the length for the border between adjacent pens).
To maximize $A$, take the derivative of the area equation after substitution.
$A=x(\frac{L-5x}{2})=\frac{Lx}{2}-\frac{5x^2}{2}$
$\frac{dA}{dx}=L/2-5x$
Finding the maximum requires setting the derivative to zero, which is attained at $x=L/10$. Thus, the short side should be one tenth of the total fencing you have. Solving for the long side yields $y=L/4$.