A Reliable Workflow for Constrained Optimization
Many optimization problems have the same underlying structure: a quantity must be maximized or minimized, but the choices are restricted by geometry, resources, capacity, or another condition. The calculation is only one part of the solution. A correct answer also requires a faithful model, a complete feasible domain, and a comparison of every relevant candidate.
This workshop develops that process through geometric and business examples. In each case, we will define the decision variable, express the constraint, construct a one-variable objective, check the feasible values, and interpret the best result.
From a Description to a One-Variable Model
Suppose a problem has two quantities, \(x\) and \(y\), linked by an equality constraint. If the constraint lets us express \(y\) in terms of \(x\), we can substitute that expression into the objective. The result is a function of one variable. This reduction is useful only if it preserves all feasible choices: the chosen variable must cover the full range allowed by the original problem, and any restrictions on the quantities must be included in its domain.
For example, if \(y=12-x^2\), then a rectangle whose width and height depend on \(x\) can be described using \(x\) alone. But the model must also require \(x\ge 0\) and \(12-x^2\ge 0\). The latter condition restricts \(x\) to \(x\le\sqrt{12}\). These restrictions are not optional details: they define which values can actually occur.
After reducing the objective, locate its feasible endpoints and any interior points where the derivative is zero or does not exist. Evaluate the objective at all such candidates. For a smooth function on a closed interval, this procedure finds a global maximum and minimum.
The theorem gives a complete candidate list, not a shortcut that identifies which candidate wins. If the derivative fails to exist at an interior point, that point must also be checked. If the feasible set is not a closed bounded interval, the theorem may not apply; for instance, an objective can approach a limiting value without attaining it.
Why the Candidate Method Works
The justification combines two standard results. The extreme value theorem says that a continuous function on a closed bounded interval attains its largest and smallest values. Thus there is at least one point in \([a,b]\) where each extremum occurs. If such a point lies at an endpoint, it is already on the candidate list. If it lies inside the interval and \(f\) is differentiable there, Fermat’s theorem says its derivative must be zero.
Consequently, every possible location of a global extremum is either an endpoint or an interior critical point. Evaluating \(f\) at this finite list, when the list is finite, determines the global extrema. The comparison is essential: the theorem does not say that every critical point is a maximum or minimum, nor that a critical point is better than an endpoint.
Give it a meaning and, where relevant, units.
Use it to eliminate other variables without losing feasible choices.
Include nonnegativity, physical limits, capacity, and any other stated restrictions.
Check endpoints, interior critical points, and any interior points where the derivative does not exist.
State the optimal choices, the objective value, and the assumptions under which they apply.
Worked Example: A Rectangle Beneath a Parabolic Arch
Worked Example: A Rectangle Beneath a Parabolic Arch
A rectangular opening is placed symmetrically beneath an arch described by \(y=12-x^2\), where \(x\) and \(y\) are measured in metres. The upper corners of the rectangle lie on the arch. Find the maximum possible area.
Let \(x\) be the horizontal coordinate of the right-hand upper corner. Symmetry puts the left-hand upper corner at \(-x\), so the rectangle’s width is \(2x\). Its height is the arch value \(12-x^2\). Therefore its area is
The width and height must be nonnegative. Thus \(x\ge 0\), and \(12-x^2\ge 0\), which gives \(x\le\sqrt{12}\). The feasible interval is \([0,\sqrt{12}]\), including the degenerate rectangles of zero area at its endpoints.
Differentiate and find interior critical points:
The negative solution is excluded because \(x\ge 0\). The candidates are \(x=0\), \(x=2\), and \(x=\sqrt{12}\). Their areas are
Thus the maximum area is \(64\text{ m}^2\), attained when \(x=2\text{ m}\). The rectangle is \(4\text{ m}\) wide and \(8\text{ m}\) high. Substitution into the arch confirms that the upper corners have height \(12-2^2=8\text{ m}\), as required.
Worked Example: A Cylinder Inside a Sphere
Worked Example: A Cylinder Inside a Sphere
A right circular cylinder is inscribed in a sphere of radius \(6\text{ cm}\), with its axis through the sphere’s centre. Find the cylinder dimensions that maximize its volume.
Let \(z\) be half the cylinder’s height and \(r\) its radius. A cross-section through the axis gives a right triangle with legs \(r\) and \(z\), and hypotenuse \(6\). Hence the constraint is \(r^2+z^2=36\), so \(r^2=36-z^2\). The cylinder height is \(2z\), and its volume becomes
The domain includes the limiting cases: \(z=0\) gives zero height, while \(z=6\) gives zero radius. Differentiate:
Since \(2\pi\ne 0\), an interior critical point satisfies \(36-3z^2=0\). Thus \(z^2=12\), and the feasible solution is \(z=2\sqrt{3}\). Evaluate the objective at the candidates:
Therefore the maximum-volume cylinder has height \(2z=4\sqrt{3}\text{ cm}\). Its radius satisfies \(r^2=36-12=24\), so \(r=2\sqrt{6}\text{ cm}\). Substitution verifies the constraint: \(r^2+z^2=24+12=36\). The candidate comparison shows that its positive volume exceeds both endpoint volumes.
Worked Example: Choosing a Production Quantity
Worked Example: Choosing a Production Quantity
A firm sells \(q\) units at a price of \(p(q)=120-3q\) dollars per unit. Its variable production cost is \(C(q)=20q+q^2\) dollars. Production capacity is \(25\) units. Treat \(q\) as continuous for this model and find the quantity that maximizes profit.
Revenue is price per unit multiplied by quantity:
Profit is revenue minus cost, so
Nonnegative production and the capacity limit give \(0\le q\le25\). The modeled price also remains nonnegative throughout this interval, since \(p(25)=120-75=45\) dollars per unit. Differentiate:
The candidate profits are
The model’s maximum occurs at \(q=12.5\) units, with profit \(\$625\). At that quantity the price is \(120-3(12.5)=\$82.50\) per unit. The calculation assumes quantity is continuous; if only whole units can be produced, the feasible choices change and the nearby integer quantities must be compared separately.
A Common Modeling Mistake: Maximizing the Wrong Quantity
In the business example, the unit price \(p(q)=120-3q\) decreases as production increases. It would be a mistake to maximize unit price and conclude that the firm should produce \(q=0\), where the price is \(\$120\) per unit. The question asks for maximum profit, not maximum price. A high price by itself does not account for how many units are sold or the cost of producing them.
The correct objective is \(P(q)=q\,p(q)-C(q)=100q-4q^2\). It gives \(P(0)=0\), whereas producing \(12.5\) units gives \(P(12.5)=\$625\). The correction is to translate the requested outcome into its actual objective function before differentiating.
Interpreting and Checking an Optimum
A mathematically correct candidate can still be an inadequate answer if it is not interpreted. State which variable values attain the optimum, give the optimized objective with appropriate units, and check that the choices satisfy the original constraints. If a result is a non-integer quantity or a limiting configuration, say so. If the model omits effects such as fixed costs, taxes, or discrete production, do not imply that its answer accounts for them.
For a one-variable problem on a closed feasible interval, a final comparison is a direct global check. For more complicated feasible sets, the same principle remains: compare only feasible candidates, include boundary possibilities, and verify that the method used actually covers the full feasible set. A derivative equation identifies possible interior optima; the model and domain determine whether they are relevant.
Check Your Understanding
Use the modeling and candidate-comparison workflow to answer these questions.
- Why must a geometric model include restrictions that make its dimensions nonnegative?
- For a continuous objective on a closed interval, which points must be checked to locate a global maximum or minimum?
- In the sphere example, why is the cylinder height \(2z\) rather than \(z\)?
- Why does maximizing unit price fail to answer the business example’s profit question?
- If a model allows only whole-number production quantities, why is the continuous critical point not necessarily the final answer?