Tutorials › Calculus I › A Complete Constrained Optimization Workshop

Optimization and Newton's Method · Tutorial 884 of 1495

A Complete Constrained Optimization Workshop

Learn to turn a constrained geometry or business problem into a one-variable model and justify which feasible candidate gives the global optimum.

Advanced 10 min read

What You'll Learn

  • Build an objective function from a geometric or business description.
  • Reduce an equality constraint to a one-variable optimization problem.
  • Determine the feasible interval using physical and business restrictions.
  • Find and compare interior critical points and boundary candidates.
  • Justify global maxima and minima on a closed feasible interval.
  • Interpret an optimum in context, including its units and assumptions.

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.

Core principle: An optimum is the best objective value among all feasible choices. A critical point is only a candidate; it must be feasible and compared with boundary candidates before it can be identified as a global optimum.

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.

Theorem: If \(f\) is continuous on a closed bounded interval \([a,b]\) and differentiable at every point in \((a,b)\), then \(f\) attains both a global maximum and a global minimum on \([a,b]\). Each interior point where either global extremum occurs must satisfy \(f'(x)=0\). Therefore the endpoints and all interior critical points together contain every possible global extremum.

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.

1
Choose the decision variable.
Give it a meaning and, where relevant, units.
2
Translate the constraint.
Use it to eliminate other variables without losing feasible choices.
3
Set the feasible domain.
Include nonnegativity, physical limits, capacity, and any other stated restrictions.
4
Find and compare candidates.
Check endpoints, interior critical points, and any interior points where the derivative does not exist.
5
Interpret the result.
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

$$ A(x)=2x(12-x^2)=24x-2x^3. $$

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:

$$ A'(x)=24-6x^2, \qquad 24-6x^2=0 \quad\Longrightarrow\quad x^2=4 \quad\Longrightarrow\quad x=2. $$

The negative solution is excluded because \(x\ge 0\). The candidates are \(x=0\), \(x=2\), and \(x=\sqrt{12}\). Their areas are

$$ A(0)=0,\qquad A(2)=2(2)(12-4)=8\cdot 8=64,\qquad A(\sqrt{12})=2\sqrt{12}(12-12)=0. $$

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

$$ V(z)=\pi r^2(2z)=2\pi(36-z^2)z, \qquad 0\le z\le 6. $$

The domain includes the limiting cases: \(z=0\) gives zero height, while \(z=6\) gives zero radius. Differentiate:

$$ V'(z)=2\pi(36-3z^2). $$

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:

$$ V(0)=0,\qquad V(6)=0, $$
$$ V(2\sqrt{3}) =2\pi(36-12)(2\sqrt{3}) =2\pi(24)(2\sqrt{3}) =96\sqrt{3}\pi\text{ cm}^3. $$

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:

$$ R(q)=q(120-3q)=120q-3q^2. $$

Profit is revenue minus cost, so

$$ P(q)=R(q)-C(q) =(120q-3q^2)-(20q+q^2) =100q-4q^2. $$

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:

$$ P'(q)=100-8q, \qquad 100-8q=0 \quad\Longrightarrow\quad q=12.5. $$

The candidate profits are

$$ P(0)=0,\qquad P(25)=100(25)-4(25)^2=2500-2500=0, $$
$$ P(12.5)=100(12.5)-4(12.5)^2 =1250-4(156.25) =1250-625 =625. $$

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.

  1. Why must a geometric model include restrictions that make its dimensions nonnegative?
  2. For a continuous objective on a closed interval, which points must be checked to locate a global maximum or minimum?
  3. In the sphere example, why is the cylinder height \(2z\) rather than \(z\)?
  4. Why does maximizing unit price fail to answer the business example’s profit question?
  5. If a model allows only whole-number production quantities, why is the continuous critical point not necessarily the final answer?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon