CLEP Calculus study materials
CLEP Calculus study resources

Optimizing the Fenced Pen

CLEP Calculus · Put your knowledge to work in context.

All case studies

Optimizing the Fenced Pen

A biology student has 60 meters of fencing to enclose a rectangular pen against a long, straight barn wall. The barn side needs no fence, so fencing covers only three sides: two widths (perpendicular to the barn) and one length (parallel to the barn). She wants the pen to have the largest possible area. A classmate suggests making the pen a square by using 20 m for each of the three fenced sides, arguing that squares maximize area. The student is unsure, and also wants to confirm her answer is truly a maximum, not just a critical point, and to know how the optimum would shift if the barn wall were removed.

1. Set up the area as a function of one variable, find the critical point, and classify it as a maximum. Give the dimensions and the maximum area.

Read the worked answer

Let w = each width (two of them) and L = the length parallel to the barn. Fencing: 2w + L = 60, so L = 60 − 2w. Area:

A(w) = w·L = w(60 − 2w) = 60w − 2w², with 0 < w < 30.

A′(w) = 60 − 4w = 0 → w = 15, so L = 60 − 30 = 30.

Classify: A″(w) = −4 < 0 everywhere, so the parabola opens downward and w = 15 is a global maximum on the interval. Maximum area = 15 × 30 = 450 m².

The classmate's square (20, 20, 20) gives area 20 × 20 = 400 m², which is smaller. The square intuition fails because only three sides are fenced - the optimum is a 1:2 rectangle, not a square.

2. Suppose the barn wall is removed, so all four sides must be fenced with the same 60 m. What are the new optimal dimensions and area, and how does this compare to the barn case?

Read the worked answer

With four sides: 2w + 2L = 60 → L = 30 − w. Area A(w) = w(30 − w) = 30w − w². A′(w) = 30 − 2w = 0 → w = 15, L = 15, a square of side 15, area 225 m².

Comparison: the barn case yields 450 m², exactly double the fully-fenced case. Intuition: the free barn wall effectively doubles the usable area per meter of fencing because one full side costs nothing. In the barn case the fenced length (30) is twice the width (15); in the closed case width equals length. This shows the square rule holds only when all four sides are constrained equally.