Applied optimization

A farmer has a fixed length of fencing. A cardboard sheet has a fixed size. In each case some quantity — area, volume, cost — depends on how the fixed resource is shaped, and the question is always the same: which single choice of dimensions makes that quantity as large or as small as possible? Applied optimization is the point where every earlier maxima/minima technique — writing a function, differentiating it, testing critical points — finally earns its keep on a real, worded problem. The whole skill is translation: turning a paragraph of English into one function of one variable, using a constraint equation to strip away the extra variable, and then letting Q′(x)=0Q'(x)=0 do the rest. This article rebuilds the general method as a repeatable seven-step recipe, derives it in full on a fencing problem, and extends the classic folded-box problem into a competitive-exam variant.

The core insight

To optimize a real quantity QQ, express it as a function of the problem's variables, use the given constraint to reduce it to one variable, then find where Q′(x)=0Q'(x)=0 and confirm a maximum or minimum with the derivative test, always restricted to the physically valid domain.

The core idea

Every applied optimization problem — however different the story — reduces to the same seven moves.

Set up. First name the quantity to optimize, QQ, and write it in terms of whatever variables the geometry naturally offers; usually there are two variables at this stage, linked by one constraint — a fixed total (fencing, surface area, sheet perimeter) that the problem hands you for free.

Reduce and solve. Use the constraint to eliminate one variable, so QQ becomes a function of a single variable xx. Differentiate and solve Q′(x)=0Q'(x)=0 for critical points, then restrict those points to the domain where the setup makes physical sense — a length or an area cannot be negative or zero.

Q′(x)=0  ⟹  x=x0,Q′′(x0){<0local maximum>0local minimumQ'(x) = 0 \implies x = x_0, \qquad Q''(x_0) \begin{cases} <0 & \text{local maximum} \\ >0 & \text{local minimum} \end{cases}

where: Q(x)Q(x) is the quantity being optimized written as a function of the single surviving variable xx, Q′(x)Q'(x) is its derivative, and x0x_0 is a critical point; the sign of the second derivative Q′′(x0)Q''(x_0) classifies it without needing to check neighbouring values by hand. On a closed domain, any candidate critical point must also be compared against the endpoint values of QQ, since the true maximum or minimum can sit at a boundary rather than at a critical point.

Report. Finally, substitute x0x_0 back to state the optimal dimensions — not just the value of xx — and give the optimized value of QQ itself, in the problem's own units.

Figure
A rectangular field beside a wall showing width x parallel to the wall and two equal sides y perpendicular to it with the enclosed area shaded
Three-sided fencing against an existing wall existing wall (no fencing needed) x (parallel to wall) y y Area A = xy red lines are fenced (three sides); the wall forms the fourth side
Derivation AFencing a maximum-area field against a wall

Working out the maximum area a fixed length of fencing can enclose against an existing wall shows why the seven-step method matters: differentiating the area directly, before using the fencing constraint to eliminate a variable, produces a function of two variables that cannot be optimized at all, so the constraint substitution in Step 4 below is the step that actually makes the problem solvable.

Step 1. Define the variables. A farmer has 4040 m of fencing to enclose a rectangular field, using an existing wall as one side, so fencing is needed on only three sides. Let xx (m) be the side parallel to the wall, and let yy (m) be each of the two sides perpendicular to the wall.

Step 2. Write the constraint. Only three sides use fencing, so the total fencing used is x+2y=40x + 2y = 40.

Step 3. Write the quantity to be optimized. The enclosed area is A=xyA = xy, a function of two variables — not yet ready for differentiation.

Step 4. Eliminate a variable using the constraint. From x+2y=40x+2y=40, x=40−2yx = 40-2y. Substituting into A=xyA=xy gives a single-variable function,

A(y)=(40−2y)y=40y−2y2.A(y) = (40-2y)y = 40y - 2y^2.

Step 5. Differentiate and solve A′(y)=0A'(y)=0. A′(y)=40−4yA'(y) = 40-4y, so A′(y)=0A'(y)=0 gives y=10y=10.

Step 6. Classify the critical point with the second-derivative test. A′′(y)=−4<0A''(y) = -4 < 0 for every yy, so y=10y=10 is a maximum, and it lies safely inside the physically valid domain 0<y<200<y<20.

Step 7. Report the dimensions and the maximum area. With y=10y=10, x=40−2(10)=20x=40-2(10)=20. The maximum enclosed area is A=xy=20×10=200 m2A = xy = 20\times10 = \boxed{200\ \text{m}^2}. Verified: A(y)=40y−2y2A(y)=40y-2y^2, A′(10)=0A'(10)=0, A′′(10)=−4<0A''(10)=-4<0, A(10)=200A(10)=200.

Worked example

An open-top rectangular box is made from a square cardboard sheet of side 1212 cm, by cutting equal squares of side xx from each corner and folding up the sides. Find the value of xx that maximizes the volume.

Step 1. After folding, the base is a square of side 12−2x12-2x and the height is xx, so the volume is V(x)=x(12−2x)2V(x) = x(12-2x)^2, already a function of the single variable xx because the sheet's fixed size is built directly into the formula.

Step 2. Determine the domain. Both x>0x>0 and 12−2x>012-2x>0 are required for the box to exist, so 0<x<60<x<6.

Step 3. Expand and differentiate. V(x)=144x−48x2+4x3V(x) = 144x - 48x^2 + 4x^3, so V′(x)=144−96x+12x2=12(x−2)(x−6)V'(x) = 144-96x+12x^2 = 12(x-2)(x-6).

Step 4. Solve V′(x)=0V'(x)=0 within the domain: x=2x=2 or x=6x=6. Since x=6x=6 makes the base side zero and lies outside the open domain (0,6)(0,6), only x=2x=2 is a valid critical point.

Step 5. Confirm a maximum. V′′(x)=−96+24xV''(x) = -96+24x, so V′′(2)=−48<0V''(2) = -48 < 0, confirming x=2x=2 is a maximum.

Step 6. Compute the maximum volume. V(2)=2(12−4)2=2(64)=128V(2) = 2(12-4)^2 = 2(64) = 128. Cutting squares of side x=2x=2 cm gives base 8×88\times8 cm and height 22 cm, so the maximum volume is 128 cm3\boxed{128\ \text{cm}^3}.

Competitive stretch

A closed cylindrical can of fixed volume V0V_0 minimizes surface area — and hence material — when its height equals its diameter, h=2rh=2r. The setup is the same recipe: write surface area S=2πr2+2πrhS = 2\pi r^2 + 2\pi rh as the quantity to minimize, use the constraint V0=πr2hV_0 = \pi r^2 h to eliminate h=V0/(πr2)h = V_0/(\pi r^2), reduce SS to a single variable S(r)=2πr2+2V0/rS(r) = 2\pi r^2 + 2V_0/r, and solve S′(r)=0S'(r)=0. This is exactly the kind of constraint-elimination step drilled above, just with a volume constraint instead of a fencing or sheet-size constraint.

Common traps

  • Differentiating a two-variable expression directly, without first using the constraint to reduce it to one variable — the single most common setup error.
  • Accepting a critical point that is outside the physically meaningful domain, such as x=6x=6 in the box problem, which forces a dimension to zero.
  • Skipping the first- or second-derivative test and assuming the only critical point found must automatically be the answer.
  • Reporting the optimal value of xx alone and forgetting to compute the actual optimized quantity — the maximum area or volume — that the question asked for.

Ask the tutor: stuck setting up the constraint for a new optimization story, like minimizing the material for a closed cylindrical can — ask the AI tutor to walk through the seven-step recipe with you on that exact problem.

Why do I need a constraint equation at all — can I not just differentiate the area or volume directly?

A quantity like area or volume usually starts out depending on two independent variables, such as xx and yy in the fencing problem. A derivative with respect to one variable while the other is free to change does not identify a single optimal shape — it only makes sense to set a derivative to zero once QQ depends on exactly one variable. The constraint is what lets you substitute one variable in terms of the other, collapsing QQ to a genuine single-variable function that Q′(x)=0Q'(x)=0 can meaningfully optimize.

How do I know whether a critical point is a maximum or a minimum without sketching a graph?

Use the second-derivative test: if Q′′(x0)<0Q''(x_0)<0 at the critical point, the function curves downward there, so it is a local maximum; if Q′′(x0)>0Q''(x_0)>0, it is a local minimum. If Q′′(x0)=0Q''(x_0)=0, the test is inconclusive and you fall back to checking the sign of Q′(x)Q'(x) just before and after x0x_0 — the first-derivative test. In the box problem, V′′(2)=−48<0V''(2)=-48<0 confirms a maximum without ever drawing the cubic.

What if a problem gives a closed domain, like 0 less than or equal to x less than or equal to 6 — do I still just solve Q prime of x equals 0?

Solving Q′(x)=0Q'(x)=0 finds interior critical points, but on a closed interval the true maximum or minimum can also occur at an endpoint, even if the derivative there is not zero. The safe procedure is to evaluate QQ at every interior critical point that lies inside the domain and at both endpoints, then compare all those values directly — the largest is the maximum and the smallest is the minimum, regardless of which derivative test each point individually passes.

Before this

Where this leads