We have 20 metres of fencing for all four sides of a rectangle. Which shape gives the greatest area? The derivative finds candidates, but permitted dimensions and endpoints also determine the answer. Use sign analysis, parabolas and derivative rules.
If one side is x metres, the other is 10−x. Include degenerate endpoint rectangles as mathematical boundary cases:
A(x) = x(10 − x), 0 ≤ x ≤ 10; A(x) = 25 − (x − 5)^(2).
The area cannot exceed 25 m²; a square of side 5 m attains it. Now recover that answer from changing area.
Increase turns to decrease
A′(x) = 10 − 2x; A′(5) = 0; A(0) = A(10) = 0, A(5) = 25.
On (0,5) the positive derivative means increasing area; on (5,10) it is negative and area decreases. A + to − sign change proves a local maximum. A positive derivative throughout an interval is sufficient for increase; an increasing function may have isolated zero derivatives, as x³ does.
Area and endpoints
A=x(10−x); A(5)=25; A(3)=21
Derivative sign
A′=10−2x
Critical points are interior domain points where the derivative vanishes or fails to exist. A continuous function on a closed bounded interval attains largest and smallest values: compare critical-point values and endpoints. A local extremum compares neighbors; a global one compares the whole permitted set. Definitions and conditions.
Second derivative and a new constraint
A′′(x) = − 2; (max)_(0 ≤ x ≤ 3)A(x) = A(3) = 21.
The second derivative measures changing slope: f″>0 means increasing slope, shape ∪; f″<0 means decreasing slope, shape ∩. Here −2 confirms a maximum at the stationary point. f″=0 alone is inconclusive: x⁴ has no concavity change at zero. Graph shape.
If the site requires x≤3, 5 is unavailable. Area increases on [0,3] and is greatest at its endpoint: 21 m², sides 3 and 7 m. Its derivative there is 4, not zero. The constraint changes the problem; optimizing a model does not guarantee practical convenience. OpenStax
Branch · DeeperOptional · may be skipped
Theorems, average slope and Jensen’s inequality
Fermat’s theorem: at an interior differentiable local extremum the derivative is zero. The converse fails: x³ has zero derivative at zero without a maximum or minimum.
Rolle: if f is continuous on [a,b], differentiable on (a,b) and f(a)=f(b), then f′(c)=0 somewhere inside. For A, endpoints 0 and 10 both have area 0, and the horizontal tangent occurs at 5. Under the first two conditions, the mean value theorem guarantees an interior tangent with the secant slope:
A′(2) = 6 = (A(4) − A(0))/(4 − 0).
On [0,4] the average slope 6 occurs at c=2. Rolle and mean value theorems.
For a convex ∪ shape, with the graph never above its chords on the interval, Jensen’s inequality states:
f(λa + (1 − λ)b) ≤ λf(a) + (1 − λ)f(b), 0 ≤ λ ≤ 1.
a,b belong to that interval. For ∩ the inequality reverses. For A, the mean of areas at x=3 and 7 is 21, while area at their mean x=5 is 25. The midpoint does at least as well because of the ∩ shape. MIT, Convex functions, slides 3–2 and 3–12.
First specify the feasible set, then find candidates and changing signs, and finally compare actual values. A 5×5 m square is optimal here only while every constraint permits it.