MATHEMATICS · LESSON 10 OF 10

Optimization

Turn a “best design” question into a function of one variable on an interval, then use derivatives to find and justify the optimum.

What this lesson explains

Optimization is where calculus pays for itself in engineering: minimum material for a container of given volume, maximum power transfer, minimum cost or energy, maximum yield. The mathematics is the closed-interval method and the derivative tests; the real skill is building the right model and checking that the answer makes physical sense.

Before you begin

Area, perimeter and volume

Rectangle: A = xy, P = 2x + 2y. Box: V = lwh. Closed cylinder: V = πr2h, surface area S = 2πr2 + 2πrh.

Extrema tests

Critical points solve f′ = 0 (or f′ undefined). First-derivative test: + → − is a maximum. Second-derivative test: f″ < 0 at a critical point is a maximum. See “Extrema and curve shape”.

The idea, made visible

Every optimization problem has an objective (the quantity to maximise or minimise, such as area, volume or cost) and one or more constraints (fixed conditions, such as a given perimeter or volume). The constraint lets you eliminate variables until the objective depends on a single variable.

The variable also has a feasible interval: lengths must be positive, a cut cannot exceed half the sheet, and so on. The interval is part of the model; the answer must lie in it.

Volume of an open box cut from a 12 cm square sheetGraph of V(x) = x(12 − 2x)² for 0 ≤ x ≤ 6, where x is the side of the corner squares. The volume is 0 at both ends of the interval and reaches its maximum 128 cm³ at x = 2.12345650100128x (cm)V (cm³)maximum: x = 2 cm, V = 128 cm³
The box volume is zero when no corner is cut (x = 0) and when the base disappears (x = 6). Between them it has a single maximum at x = 2 cm.

Then use the previous topic. Find critical points of the objective inside the interval. On a closed interval, compare the objective at the critical points and endpoints. On an open interval, justify that a critical point is the absolute optimum, for example because it is the only critical point and the first-derivative test shows a maximum (or minimum), or because the function is concave down (up) everywhere on the interval.

Finally answer the question that was asked — often the dimensions, not the maximum value — with units, and check that it is sensible (does the box have positive height? is the cost smaller than at the endpoints?).

Volume of the open box for different cuts
corner cut x (cm)base side 12 − 2x (cm)volume x(12 − 2x)² (cm³)
110100
1.59121.5
28128
2.57122.5
36108
4464

The table suggests x = 2 and the derivative confirms it. A table alone cannot prove that no other x does better.

Key terms

Objective function
The quantity to be made as large or as small as possible, written as a function of one variable after using the constraints.
Constraint
An equation (or inequality) that the variables must satisfy, such as a fixed perimeter or volume.
Feasible interval
The set of values of the variable that make physical sense (for example 0 < x < 6).
Optimum
The value of the variable that gives the largest or smallest objective, together with that objective value.

The formulas and what they mean

Symbols, meanings and units
SymbolMeaningUnit
x, y, r, hdesign variables (lengths)m, cm
A, V, S, Carea, volume, surface area, costm², m³, m², currency
x*the optimal value of the design variableunits of x
f′(x), f″(x)first and second derivatives of the objectiveobjective units per unit of x (per unit of x²)

Optimality condition

f′(x*) = 0 (x* inside the feasible interval)

Conditions and limits: Necessary for an interior optimum of a differentiable function; not sufficient on its own. Endpoints must be checked separately.

Justifying a maximum

f″(x*) < 0, or f′ changes from + to − at x*

Conditions and limits: Gives a local maximum; to call it absolute, it must be the only critical point on an interval, or be compared with the endpoints.

Closed interval

best value = max or min of { f(a), f(b), f(critical points) }

Conditions and limits: f continuous on [a, b].

Why it works: Why a square gives the largest rectangle with a fixed perimeter

Let the perimeter be P and one side x. Then the other side is P/2 − x.

  1. A(x) = x(P / 2 − x) = P / 2x − x2, for 0 < x < P / 2.

    Constraint used to eliminate the second side.

  2. A′(x) = P / 2 − 2x = 0 ⇒ x = P / 4.

    Critical point.

  3. A″(x) = −2 < 0 everywhere, so this is the absolute maximum on the interval.

    Concave down on the whole interval.

  4. The other side is P / 2 − P / 4 = P / 4: the rectangle is a square.

    Interpret the answer.

Maximum area = (P/4)² = P²/16.

A first worked example

Optimization procedure

  1. Read the problem, draw a diagram and name the variables with units.
  2. Write the objective function.
  3. Write the constraint and use it to express the objective in one variable.
  4. State the feasible interval for that variable.
  5. Differentiate, solve f′ = 0, and keep critical points inside the interval.
  6. Justify the optimum: closed-interval comparison, first-derivative test, or second-derivative test with a uniqueness argument.
  7. Answer the actual question (dimensions and/or optimal value) with units, and check that it is reasonable.

Largest rectangle with a fixed perimeter

Problem. A rectangle has perimeter 24 m. Find the side lengths giving the largest area, and that area.

  1. Sides x and y with 2x + 2y = 24, so y = 12 − x.

    Constraint.

  2. A(x) = x(12 − x) = 12x − x2, for 0 < x < 12.

    Objective in one variable, with its interval.

  3. A′(x) = 12 − 2x = 0 ⇒ x = 6.

    Critical point, inside the interval.

  4. A″(x) = −2 < 0, so x = 6 gives the maximum.

    Concave down on the whole interval.

Result: A 6 m × 6 m square, area 36 m2.

What it means: For a perimeter of 40 m the same method gives a 10 m × 10 m square of area 100 m2.

A different case

Open box from a square sheet

Problem. Equal squares of side x are cut from the corners of a 12 cm × 12 cm sheet, and the sides are folded up. Find x for maximum volume.

  1. V(x) = x(12 − 2x)2, with 0 < x < 6 (the base side 12 − 2x must be positive).

    Height x, square base of side 12 − 2x.

  2. V′(x) = (12 − 2x)2 + x·2(12 − 2x)(−2) = (12 − 2x)(12 − 6x).

    Product and chain rules, then factor.

  3. V′ = 0 ⇒ x = 6 (not inside the interval) or x = 2.

    Keep only feasible critical points.

  4. Closed-interval check on [0, 6]: V(0) = 0, V(6) = 0, V(2) = 2·82 = 128.

    The endpoints give no volume.

Result: Cut 2 cm squares; the maximum volume is 128 cm3 (base 8 cm × 8 cm, height 2 cm).

What it means: The sign of V′ is + for 0 < x < 2 and − for 2 < x < 6, confirming a maximum.

More worked cases

Each case below uses a different skill. Every step and result is shown.

Minimum material for a cylindrical can

Problem. A closed cylindrical can must hold 500 cm3. Find the radius and height that minimise the surface area.

  1. Constraint: πr2h = 500 ⇒ h = 500 / πr2.

    Fixed volume.

  2. S = 2πr2 + 2πrh = 2πr2 + 1000 / r, for r > 0.

    Substitute h.

  3. S′(r) = 4πr − 1000 / r2 = 0 ⇒ r3 = 250 / π ⇒ r ≈ 4.30 cm.

    Critical point.

  4. S″(r) = 4π + 2000 / r3 > 0 for all r > 0.

    Concave up everywhere: the only critical point is the absolute minimum.

  5. h = 500 / π(4.30)2 ≈ 8.60 cm.

    Back-substitute.

Result: r ≈ 4.30 cm, h ≈ 8.60 cm, so h = 2r (height equals diameter); S ≈ 349 cm2.

What it means: At the optimum, h = 2r exactly: from r3 = 250/π, h = 500/(πr²) = 2r. Real cans are often taller because of other costs (seams, handling).

Fencing along a river

Problem. A rectangular field along a straight river needs fencing on three sides only (none along the river). There are 200 m of fence. Find the largest possible area.

  1. Let x be the two sides perpendicular to the river and y the side parallel to it: 2x + y = 200.

    Only three sides are fenced.

  2. A(x) = x(200 − 2x) = 200x − 2x2, 0 < x < 100.

    Objective and interval.

  3. A′(x) = 200 − 4x = 0 ⇒ x = 50; A″ = −4 < 0.

    Maximum.

  4. y = 200 − 100 = 100 m; A = 50 × 100.

    Dimensions and value.

Result: 50 m × 100 m (the long side along the river), area 5000 m2.

What it means: Unlike the four-sided case, the optimum is not a square, because the river side is free.

Common misunderstandings

  • Misunderstanding: Differentiating before using the constraint (with two variables left).

    Correct idea: Reduce the objective to one variable first.

  • Misunderstanding: Ignoring the feasible interval, or keeping critical points outside it.

    Correct idea: Write the interval and discard infeasible solutions (like x = 6 in the box problem).

  • Misunderstanding: Stopping at f′ = 0 without justifying a maximum or minimum.

    Correct idea: Use the endpoint comparison, the first-derivative test or the second-derivative test.

  • Misunderstanding: Answering with the wrong quantity.

    Correct idea: If the question asks for dimensions, give the dimensions (with units), not just the optimal value.

Keep in mind

  • f′(x*) = 0 (x* inside the feasible interval)Optimality condition
  • f″(x*) < 0, or f′ changes from + to − at x*Justifying a maximum
  • best value = max or min of { f(a), f(b), f(critical points) }Closed interval

Scope of this lesson

  • Single-variable optimization only. Problems with several free variables need partial derivatives (a later course).
  • Constraints are equations that can be solved for one variable.

This is the last lesson in Mathematics. Back to the Mathematics contents.

Original study text. Sources and credits.