On this page
You have 40 m of fence for a vegetable patch. Before reading on, write down a prediction: will a long, thin pen enclose the most ground, or a square, or something in between? Roughly how many square metres?
In a study of classroom physics demonstrations, Crouch, Fagen, Callan and Mazur (2004) found that students who only watched a demonstration understood the underlying concepts no better than students who never saw it. Students who predicted the outcome first showed significantly greater understanding. So commit to a number, then test it.
What is the maximum area rectangle for a fixed fence length?
Call the width W and the length L, both in metres. The fence goes all the way round, so 2L + 2W = 40, which means L + W = 20 and L = 20 − W.
The area is A = W × L = W(20 − W) = 20W − W². Now test values:
W = 5 m gives 5 × 15 = 75 m²
W = 8 m gives 8 × 12 = 96 m²
W = 10 m gives 10 × 10 = 100 m²
W = 12 m gives 12 × 8 = 96 m²
W = 15 m gives 15 × 5 = 75 m²
The list is symmetric. A 5 m by 15 m pen is the same pen turned sideways, so the best answer has to sit in the middle, at W = 10 m. A square.
How do you prove the square gives the maximum area?
Without calculus (Class 10 level). Complete the square: 20W − W² = 100 − (W − 10)². The term (W − 10)² can never be negative, so the area can never be more than 100 m². It equals 100 m² only when W = 10.
With derivatives (Class 12 level). dA/dW = 20 − 2W, which is zero at W = 10. The second derivative is −2, which is negative, so W = 10 is a maximum. The NCERT Class 12 chapter Application of Derivatives gives a working rule for a closed interval: compare the function's values at the critical points and the end points. Here W lies between 0 and 20, and A(0) = A(20) = 0, so 100 m² at W = 10 is the absolute maximum.
Drag the sides: what does the area graph look like?
Try this on graph paper or with a slider:
Keep the perimeter fixed at 40 m.
Change the width from 0 to 20 m in steps of 1 m.
Plot area on the vertical axis against width on the horizontal axis.
Join the points and look at the top of the curve.
You get a downward parabola that touches zero at both ends and peaks at (10, 100). The top is flat: W = 9 m still gives 99 m², only 1 m² less than the square. Near a maximum, small changes in width barely cost any area. That flat top is what dA/dW = 0 looks like on a graph.
If dragging a shape helps you see this better than algebra, the Fermi Simulation Lab has interactive simulations for ideas that are easier to see than to read. For a 3D version, try our walk-through of the maximum volume open box made by cutting corners.
Is a square always the best shape for 40 m of fence?
Among rectangles, yes. If any closed shape is allowed, no. Wolfram MathWorld states the isoperimetric problem as finding the closed curve of given perimeter that encloses the greatest area, and the solution is a circle.
With 40 m of fence, a circle has radius 40/(2π), about 6.37 m, and area 40²/(4π), about 127.3 m². That is roughly 27% more ground than the square. Among triangles the same idea picks out the equilateral one, which we work through in which triangle has the maximum area for a given perimeter.
Where do students lose marks on this question?
Leaving the area in two variables. Use the perimeter to write L in terms of W first.
Stopping at dA/dW = 0. Show that it is a maximum, with the second derivative or by checking the end points.
Writing m instead of m² for the area.
Assuming the answer is a square when the constraint changes, as in the wall version.
Reversing the idea. A fixed perimeter caps the area, but a fixed area does not fix the perimeter, as our post on rectangles with the same area but different perimeters shows.
If the setup trips you up, try similar word problems in the Fermi Problem Library. Its solver explains the reasoning at each step rather than printing an answer. Then go back and check your first guess: how close was it to 100 m²?



