4.1.31 · D3Calculus I — Limits & Derivatives

Worked examples — Optimization — constrained, unconstrained, real-world problems

3,379 words15 min readBack to topic

The scenario matrix

Every optimization problem lives in one of these cells. We will solve at least one example in each row.

Cell What makes it special Where the answer lives Example
A. Interior max smooth hilltop, a critical point inside Ex 1
B. Interior min smooth valley, a critical point inside Ex 2
C. Endpoint wins derivative never zero, or critical point loses boundary of domain Ex 3
D. Degenerate / second-derivative test is blind need first-derivative sign test Ex 4
E. Constrained (substitution) one variable killed by a side relation interior of reduced problem Ex 5
F. Constrained (Lagrange) keep both variables, use tangency point Ex 6
G. Real-world word problem translate prose → symbols → derivative wherever the recipe lands Ex 7
H. Exam twist (hidden domain / units) the "obvious" root is illegal or the wrong thing is optimized after a domain / units check Ex 8

Before any symbol appears, one convention.


Cell A — Interior maximum

Forecast: guess the shape of the biggest rectangle before reading on. (Square? Long thin strip?)

Figure — Optimization — constrained, unconstrained, real-world problems
  1. Name & model. Let the sides be and (metres). Area . Why this step? We must write the thing we optimize in symbols before we can differentiate it.
  2. Constrain to one variable. The fence is the perimeter: . Why this step? has two unknowns; a 1-D derivative needs one. The perimeter relation lets us eliminate .
  3. Reduce. , with domain (a side can't be negative, and leaves nothing for ). Why this step? Now is a plain parabola in one variable — look at the red curve in the figure, an upside-down bowl.
  4. Kill the derivative. . Why this step? At the top of the ∩-shaped area curve the slope is flat, so we set the slope to zero.
  5. Classify. → cap-shaped → local maximum by the second-derivative test. Why this step? A zero slope alone could be a hilltop, a dip, or an inflection; the negative curvature confirms hilltop.
  6. Answer. , , area . The optimal pen is a square.

Cell B — Interior minimum

Forecast: will the cheapest can be tall and thin, short and fat, or something in between?

  1. Model. Surface area of a closed cylinder: (two circular lids plus the wall). Why this step? Metal used = total surface area; that is the quantity to minimize.
  2. Constrain. Volume fixes height: . Why this step? Two unknowns ; the volume condition removes .
  3. Reduce. , domain . Why this step? Now depends on alone. As the term blows up; as the term blows up — so a minimum must sit in the middle.
  4. Kill the derivative. . So . Why this step? At the bottom of the ∪-shaped cost curve the slope is flat.
  5. Classify. for all → cup → minimum. Why this step? Confirms valley, not a peak.
  6. Answer. , — note : the optimal can is exactly as tall as it is wide.

Cell C — The endpoint wins

Forecast: where's the smallest value — inside, or at one edge?

Figure — Optimization — constrained, unconstrained, real-world problems
  1. Differentiate. . Why this step? We look for flat spots first.
  2. Set . has no solution is always positive, so everywhere. Why this step? No interior critical point exists; the slope is always downhill (see the strictly falling red curve).
  3. Fall back to the Closed Interval Method. With no interior candidate, the extremes must be the two endpoints. Evaluate: (the maximum), (the minimum). Why this step? A continuous function on a closed interval always attains its extremes; if not inside, they're on the wall.
  4. Answer. Minimum value at ; maximum at .

Cell D — Second-derivative test fails ()

Forecast: is a min, a max, or neither?

  1. Find critical points. . Why this step? Flat-spot hunt.
  2. Try the second-derivative test. , so inconclusive. Why this step? The parent's Taylor argument used ; if that term vanishes and can't tell us the sign of the change.
  3. Use the first-derivative sign test instead. Check the sign of on each side:
    • For : (downhill).
    • For : (uphill). Why this step? Down-then-up around a point is precisely the fingerprint of a valley — no curvature number needed.
  4. Answer. Slope goes then local (and global) minimum at .

Cell E — Constrained by substitution

Forecast: is the closest point the vertex , or does it slide off to the side?

Figure — Optimization — constrained, unconstrained, real-world problems

The picture sets the scene: the black parabola , the red target dot at , and the red segment we will minimize dropping straight down to the vertex. Keep an eye on that segment — the algebra below will prove it is the shortest one.

  1. Model the distance — but square it. Distance from a general point on the parabola to : Why square it? is increasing, so whatever minimizes also minimizes the true distance — and the algebra stays polynomial (parent's trick, cell reused here).
  2. Substitute the constraint. We already used to write in one variable — that is the substitution route. The domain is all real : the parabola stretches infinitely both ways, so there are no endpoints to worry about. Why this step? Turns a "point on a curve" problem into ordinary 1-D optimization, and fixes exactly which -values compete.
  3. Expand & differentiate. . Why this step? Flat-spot hunt on the reduced function. (Notice the neat cancellation of the terms.)
  4. Rule out "at infinity." Since and as , the distance grows without bound far from the vertex — so no better point hides out at the tails. The single interior critical point is therefore the global minimum. Why this step? On an unbounded domain there are no endpoints; we must instead check the limiting behaviour to be sure the minimum is genuinely global.
  5. Classify. Around , goes (same cell-D reasoning, since ): down then up, a valley. Why this step? Confirms this is the nearest, not farthest, point.
  6. Answer. Nearest point is the vertex , at distance — exactly the red vertical segment in the figure.

Cell F — Constrained by Lagrange multipliers

Forecast: which direction on the unit circle points "most north-east"?

Figure — Optimization — constrained, unconstrained, real-world problems
  1. Set up the gradients. With : Why this step? At a constrained optimum, must be perpendicular to the constraint curve — i.e. parallel to (see the Lagrange condition). The red arrow points north-east; the optimum is where it lines up with the outward radius.
  2. Write . Component by component: Why this step? Parallel vectors are scalar multiples; is that scalar.
  3. Solve. Both equations give , so . Why this step? Equal partials of force equal coordinates here.
  4. Apply the constraint. with gives . Why this step? We must land on the circle, not just satisfy the tangency.
  5. Evaluate & answer.
    • : maximum.
    • : minimum.

Cell G — Real-world word problem

Forecast: does she head straight for the swimmer, or aim further down the beach to spend more time on the fast sand?

Figure — Optimization — constrained, unconstrained, real-world problems
  1. Model total time. Run distance (along the beach), swim distance . Why time, not distance? The two legs have different speeds, so time is the honest quantity to minimize (this is exactly Snell's-law / Fermat's-principle logic).
  2. Differentiate. Using the chain rule on the square root: Why chain rule? The swim distance is a function inside a square root; the chain rule handles "function of a function."
  3. Set . Let : Why this step? A flat spot marks the fastest path; setting and clearing fractions isolates the geometry. The substitution just tidies the algebra — it names the horizontal swim distance.
  4. Square carefully. Squaring is only valid when the right side is non-negative, i.e. ; we keep that restriction and will discard any root with as extraneous. Squaring: . The negative root is extraneous (it fails ), so . Why this step? Squaring can invent false solutions; the gate and a sign check remove them.
  5. Back-substitute. m. Why this step? We solved for ; the question asks for the shore point .
  6. Classify / check endpoints. s, s, and s — the interior point beats both edges, so it is the minimum. Why this step? Fermat gives only a candidate; comparing endpoints proves it's the global best on .

Cell H — Exam twist (illegal root / wrong objective)

Forecast: guess whether the field is wider along the river or perpendicular to it.

  1. Model & constrain. Fence length (two ends of length , one far side of length ). Area: . Why this step? Only three sides are fenced — reading the geometry correctly is half the exam battle.
  2. Reduce. , domain . Why this step? One variable, ready to differentiate.
  3. Kill the derivative. . Why factor out the sign? Two algebraic roots appear: and .
  4. The twist — reject the illegal root. A fence length can't be negative, so is outside the domain ; discard it. Only survives. Why this step? This is the classic exam trap: a genuine root of that is physically impossible.
  5. Classify & answer. at → minimum. Then , and m. Why this step? Positive curvature confirms the valley; report the actual fence length with units.

Recall Which cell am I in? (self-quiz)

Function is strictly increasing on — where's the max? ::: At the right endpoint (Cell C). and — next tool? ::: First-derivative sign test (Cell D). Two variables tied by one equation, want to eliminate one — which method? ::: Substitution (Cell E). Two variables, constraint hard to solve explicitly — which method? ::: Lagrange multipliers, (Cell F). Got for a length — what do you do? ::: Reject it; it's outside the physical domain (Cell H). Optimizing time across two speeds — minimize distance or time? ::: Time, since speeds differ (Cell G).


Connections

Case Map

no

yes

no

yes

yes

no

Optimization problem

One variable already?

Eliminate a variable

Constraint solvable?

Substitution

Lagrange multipliers

Kill derivative

Any flat spot?

Sign test or second derivative

Check endpoints

Reject illegal roots

Answer with units