Optimization: Maximum Area with Constraint

Optimization & Calculus 11th-12th Grade
PROBLEM
A rectangular plot of land is to be enclosed by a fence. One side is along a river and does not need to be enclosed. If the total available fencing is 1120 meters, find the dimensions of the plot that maximize area.

Let's Picture This

Before diving into equations, let's visualize what we're working with. This diagram shows our rectangular plot against the river:

A rectangular plot of land is to be enclosed by a fence. One side is along a river and does not need to be enclosed....

Notice that we need fencing for three sides: both sides perpendicular to the river (each of length y) and one side parallel to the river (length x). The river provides the fourth "wall" for free.

What You Will Learn

  • How to set up constraint optimization problems using calculus
  • Converting a two-variable problem into a single-variable function
  • Finding maximum values using derivatives and the first derivative test
  • Why geometric optimization problems often have elegant, symmetric solutions
  • How to verify optimization results using the second derivative test

Solution: Method 1 — Single-Variable Calculus Approach

Step 1 — Define variables and set up the constraint

Let x = width of the plot (parallel to the river) and y = depth of the plot (perpendicular to the river).

Since one side is along the river, we only need fencing for three sides:

Total fencing = x + y + y = x + 2y = 1120 meters

Step 2 — Express area as a function of one variable

The area of the rectangle is A = xy. From our constraint, we can solve for x:

x + 2y = 1120 x = 1120 - 2y

Substituting this into the area formula:

A(y) = xy = y(1120 - 2y) = 1120y - 2y²

Step 3 — Find the maximum using calculus

To find the maximum area, we take the derivative and set it equal to zero:

dA/dy = 1120 - 4y = 0 4y = 1120 y = 280 meters

Step 4 — Find the corresponding x-value

Using our constraint equation:

x = 1120 - 2y = 1120 - 2(280) = 1120 - 560 = 560 meters

Step 5 — Verify this is indeed a maximum

We check the second derivative:

d²A/dy² = -4 < 0

Since the second derivative is negative, we have a maximum.

Solution: Method 2 — Completing the Square

Step 1 — Start with the area function

From Method 1, we have A(y) = 1120y - 2y².

Step 2 — Factor and complete the square

Factor out the coefficient of y²:

A(y) = -2y² + 1120y = -2(y² - 560y)

Complete the square inside the parentheses:

y² - 560y = (y - 280)² - 280² y² - 560y = (y - 280)² - 78,400

Step 3 — Rewrite in vertex form

A(y) = -2[(y - 280)² - 78,400] A(y) = -2(y - 280)² + 156,800

Step 4 — Identify the maximum

This is in vertex form A(y) = a(y - h)² + k where a = -2, h = 280, and k = 156,800.

Since a < 0, the parabola opens downward, so the vertex represents the maximum. The maximum occurs at y = 280 meters, giving x = 560 meters.

The dimensions that maximize area are:
Width (parallel to river): 560 meters
Depth (perpendicular to river): 280 meters
Maximum area: 156,800 square meters

Verification

Let's verify our answer satisfies all conditions:

Fence constraint check:

x + 2y = 560 + 2(280) = 560 + 560 = 1120 ✓

Area calculation:

A = xy = 560 × 280 = 156,800 m²

Maximum verification: Let's test nearby values. If y = 275, then x = 1120 - 2(275) = 570, giving area 275 × 570 = 156,750 m². If y = 285, then x = 1120 - 2(285) = 550, giving area 285 × 550 = 156,750 m². Both are smaller than our answer of 156,800 m², confirming we found the maximum.

Does This Seem Reasonable?

Our answer tells us the optimal plot is 560m × 280m. Notice something interesting: the width along the river is exactly twice the depth. This isn't a coincidence!

The 2:1 ratio pattern: In any "three-sided fencing" problem where one side is free, the optimal rectangle always has the free side twice as long as each fenced side. This happens because we're essentially "sharing" the fencing budget optimally between the parallel and perpendicular directions.

We can also check this makes intuitive sense by considering extreme cases:

  • If the plot were very narrow (x small), we'd waste fencing on long sides perpendicular to the river
  • If the plot were very shallow (y small), we'd waste fencing on the long side parallel to the river
  • Our solution balances these competing demands optimally

Watch Out For These

✗ Mistake 1: Fencing all four sides

Setting up the constraint as 2x + 2y = 1120 because "rectangles have four sides." This ignores that one side is along the river and needs no fence. The correct constraint is x + 2y = 1120.

✗ Mistake 2: Forgetting to check which variable is which

Mixing up x and y in the final answer. Always double-check: the width along the river should be the larger dimension (560m), while the depth into the land should be smaller (280m). If you get depth > width, you've likely swapped the variables.

✗ Mistake 3: Setting up area as A = x + y instead of A = xy

Confusing perimeter with area. The area of a rectangle is length × width, not length + width. This mistake usually comes from focusing too much on the constraint equation and carrying the addition into the area formula.

The Pattern Behind This

This problem represents a classic constrained optimization situation. Here's the general approach that works for any similar problem:

General Method:
1. Identify what you want to optimize (area, volume, cost, etc.)
2. Write the constraint equation connecting your variables
3. Use the constraint to eliminate one variable
4. Express your target as a function of one variable
5. Find the maximum/minimum using calculus or algebra

The river fence pattern specifically: For any rectangular enclosure where one side needs no fencing, the optimal dimensions satisfy:

Width along free side = 2 × (Depth away from free side) Or mathematically: x = 2y when x + 2y = total fencing

This pattern appears in many contexts: fencing against walls, buildings, cliffs, or any natural boundary that provides one "free" side.

You'll See This Again In...

  • Engineering: Designing efficient storage tanks, warehouses, and enclosures where one side is against an existing structure
  • Agriculture: Planning pastures and crop fields where natural boundaries (rivers, hills, existing fences) provide free containment
  • Urban planning: Optimizing park layouts, parking lots, and building footprints against property lines
  • Economics: Similar optimization appears in production theory when one resource is "free" or unlimited

What Comes Next

This problem is your entry point to a rich world of optimization. More advanced versions include:

Multiple constraints: What if you also had a maximum depth restriction due to soil conditions?

Non-uniform costs: What if fencing parallel to the river costs differently than perpendicular fencing?

Non-rectangular shapes: Advanced calculus courses explore optimizing circular and elliptical enclosures using Lagrange multipliers.

The systematic thinking you've learned here—expressing everything in terms of one variable, then optimizing—will serve you throughout calculus and beyond.

What If?

Practice your optimization skills with these variations:

1
Corner Plot Advantage
What if the plot is in a corner where two adjacent sides are along the river (forming an L-shape with the river), so only two sides need fencing? With 1120 m of fence, what dimensions maximize the area?
Step 1 — Set up variables

Let x = width and y = length. With two sides along the river, we only fence two sides: x + y = 1120

Step 2 — Express area as function of one variable

From constraint: y = 1120 - x. So A(x) = x(1120 - x) = 1120x - x²

Step 3 — Find maximum

dA/dx = 1120 - 2x = 0, so x = 560 and y = 560

Step 4 — Verify

Check: 560 + 560 = 1120 ✓. Area = 560 × 560 = 313,600 m²

Final Answer

Optimal dimensions: 560m × 560m (a perfect square)
Maximum area: 313,600 m²

2
Reverse the Problem
You want a rectangular plot against the river with an area of exactly 156,800 m². What dimensions will minimize the amount of fencing needed?
Step 1 — Set up with area constraint

Given: xy = 156,800. Want to minimize: F = x + 2y

Step 2 — Express fence as function of one variable

From area constraint: x = 156,800/y. So F(y) = 156,800/y + 2y

Step 3 — Find minimum

dF/dy = -156,800/y² + 2 = 0. So 2 = 156,800/y², giving y² = 78,400, thus y = 280

Step 4 — Find x and total fence

x = 156,800/280 = 560. Total fence = 560 + 2(280) = 1120 m

Final Answer

Optimal dimensions: 560m × 280m
Minimum fencing needed: 1120 m

3
Adding Interior Division
Suppose you must divide the plot into two equal smaller rectangles with a fence parallel to the river. With 1120 m total for both exterior and interior fencing, find the dimensions that maximize total area.
Step 1 — Account for all fencing

Need: 2 sides of length y, plus 2 parallel sides of length x (exterior bottom + interior divider). Total: x + x + y + y = 2x + 2y = 1120

Step 2 — Simplify constraint

2x + 2y = 1120 simplifies to x + y = 560, so x = 560 - y

Step 3 — Express area and optimize

A(y) = xy = y(560 - y) = 560y - y². Taking derivative: dA/dy = 560 - 2y = 0, so y = 280

Step 4 — Find x and verify

x = 560 - 280 = 280. Check: 2(280) + 2(280) = 1120 ✓

Final Answer

Optimal dimensions: 280m × 280m (perfect square)
Maximum area: 78,400 m²

4
Different Fencing Costs
Fence parallel to the river costs $15 per meter, while fence perpendicular to the river costs $8 per meter. You have a budget of $8,960. What dimensions maximize the area?
Step 1 — Set up cost constraint

Cost = 15x + 8(2y) = 15x + 16y = 8960

Step 2 — Express x in terms of y

From constraint: 15x = 8960 - 16y, so x = (8960 - 16y)/15

Step 3 — Express area and differentiate

A(y) = xy = y(8960 - 16y)/15 = (8960y - 16y²)/15
dA/dy = (8960 - 32y)/15 = 0

Step 4 — Solve for optimal dimensions

8960 - 32y = 0, so y = 280
x = (8960 - 16(280))/15 = (8960 - 4480)/15 = 298.67

Final Answer

Optimal dimensions: 298.67m × 280m
Maximum area: 83,627 m²

Frequently Asked Questions

How do you find the maximum area of a rectangle when one dimension is constrained? +
Use the constraint equation to express one variable in terms of the other, substitute into the area formula, then find the vertex of the resulting quadratic. In this problem, the fence constraint gives us x + 2y = 1120, so x = 1120 - 2y. The area becomes A = y(1120 - 2y) = 1120y - 2y², which is maximized when y = 280 meters.
Why is the derivative method the same as completing the square for optimization? +
Both methods find the vertex of a parabola, just using different techniques. Taking the derivative and setting it to zero gives the x-coordinate of the vertex directly. Completing the square rewrites the quadratic in vertex form A = a(x - h)² + k, where the vertex is at (h, k). Here, both approaches show the maximum area occurs at y = 280 meters.
What's the general pattern for rectangle optimization problems? +
Rectangle optimization always involves expressing area as a quadratic function of one variable, then finding the vertex. The key insight is that maximum area occurs when the rectangle is 'as square as possible' given the constraints. In river problems specifically, the optimal width is always half the total available fencing.
DN

Dr. Neven Jurkovic

PhD in Mathematics • 15+ years teaching calculus and optimization

NJ
Neven Jurkovic, PhD

Professor of Computer Science, Palo Alto College, Alamo Colleges District, San Antonio, TX

Developer of Algebrator

Contact

This solution was prepared with AI assistance and reviewed by Dr. Jurkovic for mathematical accuracy and pedagogical clarity.

2026-10-23