Maximizing Rectangular Area With One Free Side

Geometry: Area & Volume 9th–10th Grade
Problem

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 = 6000 and A = xy = 6000x − 2x², where x is each side perpendicular to the river.
  • Answer:x = 1500 m, y = 3000 m, maximum area 4,500,000 m².
  • Quick check:2(1500) + 3000 = 6000 ✓ and the general shortcut Amax = 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).

A farmer has 6000 meters of fencing, and wants to enclose a rectangular plot that borders on a river. If the farmer...
Drawn with the proportions of the optimal plot (y = 2x), which we are about to discover.

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

A = x · y

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.

2x + y = 6000

Step 3 — Eliminate one variable

Solve the constraint for y, then substitute into the area formula:

y = 6000 − 2x
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

x = −b / (2a) = −6000 / (2 · (−2)) = 6000 / 4 = 1500

Step 5 — Find the other dimension and the area

y = 6000 − 2(1500) = 3000
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:

A = −2(x² − 3000x)
= −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.

Big square area = 3000 × 3000 = 9,000,000 m²
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:

√(2x · y) ≤ (2x + y)/2 = 3000
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.

The Answer
The largest area that can be enclosed is 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²)
50050002,500,000
100040004,000,000
150030004,500,000
200020004,000,000
250010002,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

✗ 2x + 2y = 6000

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 answer is x = 1500."

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?"

✗ Area = 4,500,000 m (or "4.5 million meters")

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.

✗ Assuming the best rectangle is a square (x = y = 2000)

"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:

2x + y = F → A = x(F − 2x) = −2x² + Fx
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/2 always 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 needs 2x = y.
  • Area scales with the square of the fence. Doubling F multiplies 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.

1
A Bigger Farm
The farmer buys more fencing and now has 9000 meters. With the river side still unfenced, what is the largest area that can be enclosed, and what are the dimensions?
Step 1 — Constraint

Three sides are fenced: 2x + y = 9000, so y = 9000 − 2x.

Step 2 — Area function

A = x(9000 − 2x) = 9000x − 2x².

Step 3 — Vertex

x = −9000 / (2 · (−2)) = 2250, so y = 9000 − 4500 = 4500.

Step 4 — Area

A = 2250 × 4500 = 10,125,000 m².

Step 5 — Verify

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².

2
No River at All
After a flood scare, the farmer decides to fence all four sides of a rectangular plot, with no river involved. Using the same 6000 meters, what is the largest area now, and how does it compare with the river case?
Step 1 — Constraint

All four sides are fenced: 2x + 2y = 6000, so y = 3000 − x.

Step 2 — Area function

A = x(3000 − x) = 3000x − x².

Step 3 — Vertex

x = −3000 / (2 · (−1)) = 1500, so y = 3000 − 1500 = 1500. The best shape is a square.

Step 4 — Area and comparison

A = 1500 × 1500 = 2,250,000 m². The river case gave 4,500,000 m².

Step 5 — Verify

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.

3
Flip It: Fix the Area, Minimize the Fence
The farmer needs to enclose exactly 8,000,000 square meters against the river, with the river side unfenced. What is the least amount of fencing that will do the job, and what are the dimensions?
Step 1 — Area constraint

xy = 8,000,000, so y = 8,000,000 / x.

Step 2 — Fence function

Fence length is F = 2x + y = 2x + 8,000,000 / x.

Step 3 — Minimize with AM–GM

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.

Step 4 — Find x and y

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.

Step 5 — Verify

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.

4
Two Pens Side by Side
The farmer wants two identical adjacent pens along the river, separated by a fence perpendicular to the river, so that both pens touch the river. The total outer length along the river is unfenced, and the farmer has 6000 meters of fencing for everything else, including the divider. What is the largest total area, and what are the dimensions of the whole enclosure and each pen?
Step 1 — Count the fence

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.

Step 2 — Area function

Total area A = x(6000 − 3x) = 6000x − 3x².

Step 3 — Vertex

x = −6000 / (2 · (−3)) = 1000, so y = 6000 − 3000 = 3000.

Step 4 — Area and pen sizes

Total area = 1000 × 3000 = 3,000,000 m². Each pen is 1500 m × 1000 m = 1,500,000 m².

Step 5 — Verify

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

Let x be each of the two sides perpendicular to the river (or wall) and y the side parallel to it. Only three sides are fenced, so the fence constraint is 2x + y = F. Solve for y, substitute into A = xy to get a quadratic in x, and find its vertex. In this example, with F = 6000 m, y = 6000 − 2x and A = 6000x − 2x². The vertex is at x = 6000 ÷ 4 = 1500 m, so y = 3000 m and the maximum area is 1500 × 3000 = 4,500,000 m².
Because the coefficient of x² is negative, the parabola opens downward and its vertex is the highest point. The vertex is at x = −b ÷ (2a). In this example, a = −2 and b = 6000, so x = −6000 ÷ (−4) = 1500. Substituting back gives A = 6000(1500) − 2(1500)² = 9,000,000 − 4,500,000 = 4,500,000. You can also complete the square: A = −2(x − 1500)² + 4,500,000, which shows the maximum directly.
A square is only optimal when all four sides cost fence. When the river replaces one side, the best shape is twice as long as it is deep. Reflecting the plot across the river creates a rectangle with a full perimeter, and a fixed perimeter gives the most area as a square. That square is made of two of your plots, so each plot is a 1 : 2 rectangle. In this example, the optimal plot is 1500 m by 3000 m, with area 4,500,000 m². A square plot using the same fence (2000 m by 2000 m) would enclose only 4,000,000 m².
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-11-03