Optimization Problems and Advanced Extrema

An optimization problem asks for the largest or smallest value of a quantity under given conditions; it is solved by writing the quantity as a function of one variable, finding the critical points with the derivative and comparing them with the endpoints. In brief: a rectangle with perimeter 40 has area A(x) = x(20 − x), and A′(x) = 20 − 2x = 0 gives x = 10, a square with the maximal area 100. A closed can of volume 500 cm3 has minimal surface area when its height equals its diameter.

Optimization is the most important application of differential calculus. The hard part is modelling: translating a verbal problem into a function and its domain. The calculus part follows a fixed routine. This guide provides the routine, worked problems from geometry, economics, physics and distance, a section on constraints and the method of substitution, a short introduction to extrema with a constraint (Lagrange idea) and a table of classic results.

What is the routine for optimization problems?

  1. Draw a diagram and name the variables.
  2. Write the quantity to optimise (the objective).
  3. Use the constraint to eliminate all but one variable.
  4. State the domain (from the physical meaning, such as lengths > 0).
  5. Differentiate, solve f′ = 0, and check endpoints and points where f′ does not exist.
  6. Use the first or second derivative test or compare values to find the maximum or minimum.
  7. Answer the question in words, with units.

Geometry problems

Problem 1: a fenced area along a river

A farmer has 200 m of fence and wants to enclose a rectangle along a straight river (no fence along the river). Let x be the length of each side perpendicular to the river. The side parallel to the river is 200 − 2x. A(x) = x(200 − 2x) = 200x − 2x2, domain 0 < x < 100. A′ = 200 − 4x = 0 gives x = 50, A″ = −4 < 0 (maximum). The dimensions are 50 m by 100 m, with area 5,000 m2.

100 50 50 5000

Problem 2: the open box

A square sheet of side 12 cm: cut squares of side x from the corners and fold up the sides to make an open box. V(x) = x(12 − 2x)2, domain 0 < x < 6. V′ = (12 − 2x)2 + x · 2(12 − 2x)(−2) = (12 − 2x)(12 − 2x − 4x) = (12 − 2x)(12 − 6x). Zero at x = 2 (x = 6 is an endpoint). V(2) = 2 · 82 = 128 cm3. The values at the ends are 0, so the maximum volume is 128 cm3.

1 2 3 4 5 6 128
2 12 8

Problem 3: the can

A closed cylinder with volume V = 500 cm3 and minimal surface area. S = 2πr2 + 2πrh with h = V/(πr2), so S(r) = 2πr2 + 2V/r. S′ = 4πr − 2V/r2 = 0 gives r3 = V/(2π) = 79.58, r = 4.30 cm, and h = 500/(π · 18.5) = 8.60 cm = 2r. The minimal surface is S = 2π · 18.5 + 1000/4.30 = 116.2 + 232.6 ≈ 348.8 cm2.

4.30 348.8

Problem 4: the largest rectangle in a semicircle

A rectangle is inscribed in a semicircle of radius R with a side on the diameter. With half-width x, the height is √(R2 − x2), and the area is A = 2x√(R2 − x2). Maximise A2 = 4x2(R2 − x2): derivative 8xR2 − 16x3 = 0, so x = R/√2, and A = 2(R/√2)(R/√2) = R2. For R = 10, the largest area is 100.

2x 10 7.07

Economics and physics problems

Problem 5: maximum profit

The demand is q = 600 − 5p units at price p, and the cost is C = 40q + 2,000. The profit is P(p) = p · q − C = (p − 40)(600 − 5p) − 2,000 = −5p2 + 800p − 26,000. Then P′(p) = −10p + 800 = 0 gives p = 80, and P″ = −10 < 0 shows a maximum. At p = 80 the demand is q = 200 units and the profit is P(80) = −32,000 + 64,000 − 26,000 = 6,000.

80 6000

Problem 6: average cost

C(q) = 0.01q2 + 2q + 400. The average cost A(q) = C/q = 0.01q + 2 + 400/q. A′ = 0.01 − 400/q2 = 0 gives q = 200. A(200) = 2 + 2 + 2 = 6. At this point, the marginal cost C′(200) = 0.02 · 200 + 2 = 6 equals the average cost, a general property of the minimum average cost.

200 6

Problem 7: the range of a projectile

A projectile launched at the speed v and angle θ travels the distance R = v2 sin(2θ)/g. For fixed v, R is maximal when sin 2θ = 1, θ = 45° (derivative: 2v2 cos 2θ/g = 0). For v = 20 m/s and g = 9.8: Rmax = 400/9.8 ≈ 40.8 m.

Distance and shortest-path problems

Problem 8: the closest point

Find the point on y = √x closest to (4, 0). The squared distance D(x) = (x − 4)2 + x. D′ = 2(x − 4) + 1 = 2x − 7 = 0, so x = 3.5, y = √3.5 ≈ 1.871, and the minimal distance is √(0.25 + 3.5) = √3.75 ≈ 1.936. (Minimising the square of the distance avoids the root.)

4

Problem 9: rowing and walking

A person in a boat is at point A, 3 km from the nearest point B of a straight shore, and wants to reach point C on the shore, 6 km from B. The person rows at 4 km/h and walks at 5 km/h. Let x be the distance from B to the landing point P. The time is T(x) = √(9 + x2)/4 + (6 − x)/5, for 0 ≤ x ≤ 6. T′(x) = x/(4√(9 + x2)) − 1/5 = 0 gives 5x = 4√(9 + x2), so 25x2 = 16(9 + x2), 9x2 = 144 and x = 4. Compare the values: T(0) = 0.75 + 1.2 = 1.95 h, T(4) = 5/4 + 2/5 = 1.65 h and T(6) = √45/4 ≈ 1.68 h. The minimum time is 1.65 h, by landing 4 km from B. The same method with two speeds gives the law of refraction of light (Snell’s law).

3 4 2 A B P C

What are more advanced aspects?

Problem 10: a corner minimum

Minimise f(x) = |x − 1| + |x − 4| + |x − 6| (the total distance from three points on a line). The function is piecewise linear, and its minimum is at the median of the points, x = 4: f(4) = 3 + 0 + 2 = 5. The derivative does not exist at the points 1, 4, 6, and the minimum occurs at one of them.

Table of classic results

Classic optimization results
Problem Optimal choice Optimal value
Rectangle with perimeter P: largest areasquare, side P/4P2/16
Fence along a river, 200 m50 m × 100 m5,000 m2
Open box from 12 cm squarex = 2 cm128 cm3
Can of volume V: least surfaceh = 2rS = 6πr2
Projectile rangeθ = 45°v2/g
Average costmarginal = average costq = 200 in Problem 6

Where do optimization problems come from?

Dido’s problem, in the legend of Carthage, asks for the largest area enclosed by a fixed length of boundary, and the isoperimetric problem was studied by the Greeks. Fermat applied his method of maxima and minima to optics in the 1650s, and derived the law of refraction from the principle of least time. In the eighteenth century, Euler and Lagrange created the calculus of variations for optimising whole functions, such as the shape of a hanging chain.

Where is optimization used?

Businesses maximise profit and minimise cost, engineers minimise material and weight, logistics companies minimise routes, and machine learning algorithms minimise an error function by repeatedly moving downhill along the derivative (gradient descent). Nature also optimises: soap bubbles minimise surface area, and light takes the path of least time.

Which mistakes are common?

Forgetting the domain

x = −3 may solve f′ = 0, but a negative length is impossible. Check that the answer lies in the domain.

Not checking that the critical point is a maximum or a minimum

Use a derivative test or compare the values at the critical point and endpoints.

Optimising the wrong quantity

Make sure that the function you differentiate is the one to be maximised, expressed in one variable.

Answering with x instead of the question

If the question asks for the maximal area, give the area, not the value of x.