Resources
Optimization, and the step that is not calculus
Optimization problems often look different because the stories are different. A fence, an open box, and a shortest-distance problem can all have the same mathematical structure. The derivative usually comes late, and the setup comes first.
The structure of an optimization problem
Most problems require four pieces.
- A quantity to optimize.
- A constraint relating the variables.
- A domain for the remaining variable.
- A method for locating and comparing candidate extrema.
The first three steps are usually where the real decisions are made. The domain is especially important because it often comes from the context rather than from the algebra alone.
Three examples with the same structure
On the left, the situation, redrawn as the free variable moves. On the right, the quantity being optimized plotted against that variable, with the feasible domain shaded and the candidates marked: filled dots for critical points, bars at the ends for endpoints. The panel carries the constraint, the objective, the domain, and every candidate with its value, which together are the whole write-up. The third problem has no endpoints at all, and its panel says so.
The visualization shows a physical or geometric setup beside the corresponding objective function. The feasible domain is marked, along with critical points and endpoints.
A fenced region
Suppose three sides of a rectangle use 100 meters of fencing. Let \(x\) be the width and \(y\) the remaining side, so the constraint is \(2x+y=100\) and \(y=100-2x\). The area is
\[A(x)=x(100-2x)\]The physical domain is \(0\le x\le50\). Differentiating gives \(A'(x)=100-4x\), so the interior critical point is \(x=25\). Evaluating the area at the candidates gives \(A(0)=0,\; A(25)=1250,\; A(50)=0\), so the maximum area is \(1250\) square meters. The question asks for the area, not only the value of \(x\).
An open box
Suppose squares of side length \(x\) are cut from the corners of a 12-by-12 sheet and the sides are folded upward. The volume is
\[V(x)=x(12-2x)^2\]The geometry requires \(0\le x\le6\). Differentiating gives \(V'(x)=12(x-2)(x-6)\), so the candidates on the closed interval are \(x=0,\; x=2,\; x=6\). The corresponding volumes are \(0,\; 128,\; 0\), so the maximum volume is \(128\).
Distance to a curve
Now minimize the distance from \((0,2)\) to the parabola \(y=x^2\). The squared distance is
\[D^2(x) = x^2+(x^2-2)^2 = x^4-3x^2+4\]Because square root is increasing, minimizing \(D^2\) also minimizes \(D\). Differentiating gives \(\tfrac{d}{dx}D^2(x) = 2x(2x^2-3)\), so the critical points are \(x=0\) and \(x=\pm\sqrt{\tfrac32}\). There is no closed bounded interval here, so there are no endpoints to check.
At \(x=0\), we get \(D^2=4\). At \(x=\pm\sqrt{\tfrac32}\), we get \(D^2=\tfrac74\). Therefore the minimum distance is \(D=\tfrac{\sqrt7}{2}\), and the square-root shortcut has to be undone in the final answer because the problem asks for a distance.
The Candidates Test
For a continuous function on a closed interval, absolute extrema can occur at interior critical points or endpoints. So the standard procedure is:
- find the critical points
- include the endpoints
- evaluate the objective at every candidate
- compare
A critical point is a point where the derivative is zero or fails to exist. Finding one critical point is not enough, because it may be a local maximum, local minimum, or neither. On an open or unbounded domain, endpoint comparison may not be available, and then a derivative test, global argument, or analysis of end behavior may be needed.
Answer the quantity that was asked for
Optimization problems often ask for a quantity different from the variable used during the calculus. A problem may ask for maximum area but require solving first for a width. It may ask for volume but require finding the cut size, or it may ask for distance while the simpler objective is squared distance. So the last step should return to the original question and state the requested quantity with appropriate units.
A useful practice exercise is to set up several optimization problems without differentiating them. For each one, write only:
- the objective
- the constraint
- the domain
If those three lines are correct, the calculus that follows is usually routine.