Maximizing Rectangular Area With One Free Side
A farmer has 6000 meters of fencing, and wants to enclose a rectangular plot that borders on a river. If the farmer does not fence the side along the river, what is the largest area that can be enclosed?
Already Got the Answer?
- Setup:
2x + y = 6000andA = xy = 6000x − 2x², wherexis each side perpendicular to the river. - Answer:
x = 1500 m,y = 3000 m, maximum area4,500,000 m². - Quick check:
2(1500) + 3000 = 6000✓ and the general shortcutAmax = F²/8 = 6000²/8 = 4,500,000✓.
If your number matches, skip to the pitfalls, the general pattern, and the four What-If problems below. They are where the real learning is.
What You Will Learn
- Turning a story into a constraint. Fence totals translate into an equation, and the equation depends on which sides actually get fenced.
- Reducing two variables to one. Substituting a constraint into a formula is the central move of nearly every optimization problem.
- Reading a parabola as a maximum. You will see why a negative leading coefficient means a peak, and how to find it by vertex formula or by completing the square.
- Three ways to see the same answer. Algebra, a reflection trick, and the AM–GM inequality all land on 1500 m and 3000 m, and comparing them builds real insight.
- Why "a square is best" is only sometimes true. The river changes the optimal shape to a 1 : 2 rectangle.
Let's Draw It
Before any algebra, picture the plot. The river does the work of one side, so fence goes on only three sides: two of length x (perpendicular to the river) and one of length y (parallel to it).
Solution: Method 1 — Write the Area as a Parabola and Find Its Peak
This is the standard route for a first optimization problem: get everything in terms of one variable, then recognize the shape of the resulting function.
Step 1 — Define the variables
Let x be the length of each side perpendicular to the river and y the length of the side parallel to it. The area we want to maximize is
Step 2 — Write the fence constraint
The farmer fences two sides of length x and one of length y. The river handles the fourth. All 6000 m of fencing should be used, because leftover fence could always make the plot bigger.
Step 3 — Eliminate one variable
Solve the constraint for y, then substitute into the area formula:
A(x) = x(6000 − 2x) = 6000x − 2x²
The sensible values of x are 0 < x < 3000. If x were 3000, the two sides would use up all the fence and leave y = 0.
Step 4 — Recognize the shape and locate the vertex
Rewrite as A = −2x² + 6000x. This is a quadratic with a = −2 and b = 6000. Since a < 0, the parabola opens downward and its vertex is the maximum. The vertex is at
Step 5 — Find the other dimension and the area
A = 1500 × 3000 = 4,500,000 m²
Step 6 — See why it is a maximum (completing the square)
Factor out −2 and complete the square:
= −2(x² − 3000x + 1,500²) + 2(1,500²)
= −2(x − 1500)² + 4,500,000
The term −2(x − 1500)² is never positive. It equals zero only when x = 1500. So A can never exceed 4,500,000, and it reaches that value exactly at x = 1500. This form shows the peak directly, with no formula to memorize.
Solution: Method 2 — Reflect the Plot Across the River
This method needs almost no algebra, and the idea shows up all over geometry. Pretend the river is a mirror and reflect the plot across it. The plot and its mirror image together form one big rectangle of width y and height 2x.
The reasoning
The original fence 2x + y equals 6000 m, and its reflection uses another 6000 m. The combined rectangle therefore has a full perimeter of 12,000 m, and the river line runs through its middle, so it needs no fence of its own.
Now use a classic fact: among all rectangles with a fixed perimeter, the square has the greatest area. So the big rectangle should be a square with side 12,000 ÷ 4 = 3000 m. That gives y = 3000 and 2x = 3000, so x = 1500.
Our plot is half of it: 9,000,000 ÷ 2 = 4,500,000 m²
Same answer, no parabola. This also explains the 1 : 2 shape of the optimal plot: it is half of a square, cut along its midline.
Solution: Method 3 — AM–GM in Two Lines
For two positive numbers, the arithmetic mean is at least the geometric mean: (p + q)/2 ≥ √(pq), with equality only when p = q. Apply it to p = 2x and q = y, whose sum is the known 6000:
2xy ≤ 3000² = 9,000,000
xy ≤ 4,500,000
Equality holds exactly when 2x = y. Combined with 2x + y = 6000, that gives y = 3000 and x = 1500. The key insight is that when two quantities have a fixed sum, their product is largest when they are equal. Here the "quantities" are 2x and y, the fence going down and the fence going across.
4,500,000 m², with the two sides perpendicular to the river each 1500 m and the side parallel to the river 3000 m. This is 4.5 square kilometers.
Verification
Fence check:1500 + 3000 + 1500 = 6000 m. ✓ All the fencing is used, and no more.
Area check:1500 × 3000 = 4,500,000 m². ✓
Independent check: The completed-square form gives A(1500) = −2(0)² + 4,500,000 = 4,500,000. ✓ Methods 2 and 3 produced the same value from entirely different reasoning.
Neighbors check: Try x = 1400, so y = 3200 and A = 4,480,000. Try x = 1600, so y = 2800 and A = 4,480,000. Both are smaller than 4,500,000, as they must be for a maximum. ✓
Sanity Check
Here is what happens as we slide x up and down. Notice that the area rises, peaks, and falls, and that the table is symmetric around x = 1500, just as a parabola should be.
| x (m) | y = 6000 − 2x (m) | Area (m²) |
|---|---|---|
| 500 | 5000 | 2,500,000 |
| 1000 | 4000 | 4,000,000 |
| 1500 | 3000 | 4,500,000 |
| 2000 | 2000 | 4,000,000 |
| 2500 | 1000 | 2,500,000 |
The row x = y = 2000 is a perfect square plot, and it is not the best. It encloses 500,000 m² less than the 1500 × 3000 plot. Our instinct that squares are optimal needs an adjustment here, and the Underlying Pattern section explains exactly why.
What Trips People Up
This is the full-perimeter equation, which treats all four sides as fenced. The whole problem hinges on the river: one of the long sides costs nothing. Always count the fenced sides from the picture. Here the correct constraint is 2x + y = 6000. Using the wrong one gives x = y = 1500 and an area of only 2,250,000 m², exactly half the true maximum.
The vertex formula gives the input that maximizes the area, not the maximum area itself. The question asks for the largest area, so you must substitute back: A(1500) = 4,500,000. Before finalizing, reread the question and ask "what quantity am I being asked for?"
Fencing is measured in meters (length), but area is measured in square meters. Writing m instead of m² is more than a formatting slip, because it says the answer is a length. Also note that 6000 m of fence only has to be a perimeter-like length, while 4,500,000 m² is a region.
"Squares maximize area" is true for a fixed perimeter. Here one side is free, so the constraint is different and so is the best shape. A square with the same fence (2000 + 2000 + 2000 = 6000) yields 4,000,000 m², which is 11% less than the best plot.
The Pattern Behind This
Repeat the argument with a general amount of fencing F in place of 6000:
x = F/4, y = F/2, Amax = F²/8
Check with our numbers: 6000² / 8 = 36,000,000 / 8 = 4,500,000. ✓ Two things stand out:
- Half the fence goes along the river. The parallel side
y = F/2always takes half the fencing, and the two short sides share the other half. That is the "1 : 2 rule", and it follows from Method 3, where the optimum needs2x = y. - Area scales with the square of the fence. Doubling
Fmultiplies the best area by four, not two. This is a general feature of area and length.
A limit of the shortcut:A = F²/8 only applies to one free side and a single rectangle. Adding a divider, or fencing all four sides, changes the constraint, and with it the formulas. The What-If problems below explore this.
The structural lesson reaches well beyond fences: for a fixed budget split between two factors that multiply, the product is largest when each factor receives the same amount of the budget. Here the "budget" is split evenly between the cross-river fence (2x) and the along-river fence (y).
Beyond the Textbook
- Farm and garden layout: The same constraint appears whenever a wall, barn, or property line serves as one side of an enclosure, such as a dog run or a vegetable bed against a fence.
- Material-minimizing packaging: Engineers flip the problem around, fixing the volume and minimizing the material, which is the same optimization seen from the other direction (What-If #3).
- Business and economics: Revenue = price × quantity gives a downward parabola just like this one, and finding its peak is how a simple pricing model finds the best price.
A Brief History
Maximizing an area for a fixed boundary is among the oldest optimization questions in mathematics. Ancient Greek geometers knew that among rectangles of equal perimeter the square encloses the most, and the legend of Queen Dido founding Carthage on as much land as an ox hide could surround is the classic ancestor of the problem. It persists in classrooms because it is the cleanest place to meet the idea that a "best" answer can be found by a method rather than by guessing, an idea that later became calculus.
Where This Leads
Once you are comfortable with a quadratic peak, the next step is problems where the constraint is not linear. These include fixing the area and minimizing the fence (What-If #3), or enclosing a region with a curved boundary such as a semicircle against the river. These problems are solved with calculus: set the derivative of A(x) equal to zero. For ours, A′(x) = 6000 − 4x = 0 gives x = 1500, the same answer we found without calculus.
Extend Your Thinking
Try each one yourself before opening the solution. They get progressively harder, and the last one changes the structure of the constraint.
Three sides are fenced: 2x + y = 9000, so y = 9000 − 2x.
A = x(9000 − 2x) = 9000x − 2x².
x = −9000 / (2 · (−2)) = 2250, so y = 9000 − 4500 = 4500.
A = 2250 × 4500 = 10,125,000 m².
Fence: 2250 + 4500 + 2250 = 9000 ✓. Shortcut: F²/8 = 81,000,000 / 8 = 10,125,000 ✓.
Answer: 10,125,000 m², with x = 2250 m and y = 4500 m. Fence increased by 1.5×, and area increased by 2.25×, which is 1.5².
All four sides are fenced: 2x + 2y = 6000, so y = 3000 − x.
A = x(3000 − x) = 3000x − x².
x = −3000 / (2 · (−1)) = 1500, so y = 3000 − 1500 = 1500. The best shape is a square.
A = 1500 × 1500 = 2,250,000 m². The river case gave 4,500,000 m².
Perimeter: 4 × 1500 = 6000 ✓.
Answer: 2,250,000 m². The river doubles the best area, because the river side acts as free fencing. This matches the reflection idea, where the river-case plot was half of a 3000 × 3000 square.
xy = 8,000,000, so y = 8,000,000 / x.
Fence length is F = 2x + y = 2x + 8,000,000 / x.
For positive numbers, 2x + 8,000,000/x ≥ 2√(2x · 8,000,000/x) = 2√16,000,000 = 2 · 4000 = 8000. Equality holds when 2x = 8,000,000/x.
2x² = 8,000,000 gives x² = 4,000,000, so x = 2000 and y = 8,000,000 / 2000 = 4000. Notice that y = 2x, the same 1 : 2 shape as before.
Area: 2000 × 4000 = 8,000,000 ✓. Fence: 2000 + 4000 + 2000 = 8000 ✓. Compare with the shortcut: with F = 8000, F²/8 = 64,000,000 / 8 = 8,000,000 ✓.
Answer: at least 8000 m of fencing, using x = 2000 m and y = 4000 m. This is the "dual" of the original problem: maximizing area for a fixed fence is the same as minimizing fence for a fixed area.
Perpendicular fences: two ends plus one divider, which is three fences of length x. Parallel fence: one long side of length y. So 3x + y = 6000 and y = 6000 − 3x.
Total area A = x(6000 − 3x) = 6000x − 3x².
x = −6000 / (2 · (−3)) = 1000, so y = 6000 − 3000 = 3000.
Total area = 1000 × 3000 = 3,000,000 m². Each pen is 1500 m × 1000 m = 1,500,000 m².
Fence: 3(1000) + 3000 = 6000 ✓. Area: 1000 × 3000 = 3,000,000 ✓. Neighbors: x = 900 gives y = 3300 and A = 2,970,000; x = 1100 gives y = 2700 and A = 2,970,000. Both are smaller ✓.
Answer: 3,000,000 m² total (x = 1000 m, y = 3000 m). The divider uses fence without adding any new boundary of the outer shape, so the best area drops from 4,500,000 to 3,000,000. The same balancing rule applies: half the fence (3000 m) runs along the river, and the other half is split among the three cross fences.
Frequently Asked Questions
2026-11-03