Optimization in 3D

A volume curve peaking at x equals 2 on a graph, with a flat sheet and the open box it folds into.Drag to turn

An optimization problem asks for the largest or smallest value of a quantity, such as volume or cost, under a stated constraint. Calculus solves it by finding the critical points, where the derivative is zero or does not exist, and comparing the values there with the values at the endpoints of the allowed interval.

What an optimization problem asks for

The quantity to be made largest or smallest is called the objective function. The constraint is a fixed condition that links the variables, such as a set amount of material or a set volume. Typical goals are the biggest box from a sheet, the cheapest can for a given volume, or the shortest path between two points.

Calculus helps because a smooth function has a horizontal tangent at an interior maximum or minimum. The derivative is zero at such points. These points are called critical points.

The standard method in five steps

First, draw the situation and name the variables. Second, write the objective function, then use the constraint to eliminate variables until only one remains. Third, state the domain, meaning the values that make physical sense.

Fourth, differentiate and solve for the critical points inside the domain. Fifth, evaluate the objective at each critical point and at each endpoint. The largest or smallest of these values is the answer. On a closed interval, a continuous function always attains both a maximum and a minimum.

Worked example: an open box from a square sheet

Take a square sheet of side 12 cm. Cut a square of side x from each corner and fold up the sides. The base has side 12 − 2x and the height is x, so V = x(12 − 2x)^2. The domain is 0 ≤ x ≤ 6.

Differentiate with the product and chain rules: V' = (12 − 2x)^2 + x · 2(12 − 2x)(−2) = (12 − 2x)(12 − 6x). This is zero at x = 6 and x = 2. Now compare values. V(0) = 0, V(6) = 6 · 0 = 0, and V(2) = 2 · 8^2 = 2 · 64 = 128. The maximum volume is 128 cm³, with corner squares of side 2 cm.

Worked case: the can of fixed volume

A closed cylinder of radius r and height h has volume V = πr²h and surface area S = 2πr² + 2πrh. Substituting h = V/(πr²) gives S = 2πr² + 2V/r. Then S' = 4πr − 2V/r², which is zero when r³ = V/(2π).

Putting this back into h = V/(πr²) gives h = 2r. The least material is used when the height equals the diameter. Real cans often differ because of manufacturing, seams and shelf space.

Common mistakes and where the method appears

A frequent error is to find a critical point and stop. A critical point can be a minimum, a maximum or neither, so it must be checked against the endpoints or with the second derivative. Another error is to ignore the domain, which can make a result physically impossible.

Optimization appears in engineering design, economics (maximum profit, minimum average cost), physics (shortest time paths) and statistics (least squares fitting). With several variables, the same idea uses the gradient instead of a single derivative.

Key terms

Objective function
The quantity to be maximized or minimized, written in terms of one variable after the constraint is used.
Constraint
A condition linking the variables, such as a fixed volume or fixed amount of material.
Critical point
An interior point of the domain where the derivative is zero or does not exist.
Domain
The set of input values that make sense for the problem.
Second derivative test
A check that classifies a critical point: a positive second derivative indicates a local minimum, a negative one a local maximum.
Extreme value theorem
A continuous function on a closed interval attains both a maximum and a minimum there.

Common questions

Why must endpoints be checked?

The largest or smallest value can occur at the edge of the domain, where the derivative need not be zero. In the box example the endpoints give volume 0, so the critical point wins, but this must be confirmed by comparing values.

How do I know whether a critical point is a maximum or a minimum?

Compare function values at all candidates, or use the second derivative. A negative second derivative at the point means a local maximum, and a positive one means a local minimum. If it is zero, the test gives no answer.

What if the problem has two variables?

Use the constraint to solve for one variable and substitute it into the objective. This leaves a single-variable function that can be differentiated as usual.

Learn this with a tutor

Sidechair's AI tutor will teach this topic in 3D. Join the waitlist for early access.

We'll only email you about Sidechair. Read our privacy policy.