Optimization

In optimization problems, we look for the maximum or minimum value of a quantity and the specific input that achieves it. The strategy is to express the quantity as a function of one variable, determine the domain, then find and classify critical points using the First or Second Derivative Test.

Strategy

Strategy for Solving Optimization Problems

  1. Identify the dependent variable to be maximized or minimized, and every variable that plays a role. Assign letters that remind you of their meaning.

  2. Write a primary equation relating the quantity to be optimized to the other variables.

  3. If the primary equation involves more than one independent variable, use secondary equations (constraints) to eliminate extra variables and reduce to a single-variable function. A diagram often helps find the secondary equation.

  4. Determine the domain of the independent variable. The domain may be smaller than the natural domain because of limitations inherent to the problem.

  5. Test the critical points and endpoints of the domain. Use the First Derivative Test or the Second Derivative Test to classify critical points.

Examples

Find two nonnegative numbers whose sum is 50 such that their product is as large as possible.

Solution Let one number be x ; the other is 50 x . Their product is f ( x ) = x ( 50 x ) = 50 x x 2 . Because both numbers must be nonnegative, the domain is $[0,50]$. Since f is continuous on the closed interval $[0,50]$, it attains an absolute maximum. The only critical point comes from f'(x)=50-2x=0\Rightarrow x=25. Comparing values at the critical point and endpoints: f ( 0 ) = 0 , f ( 25 ) = 625 , f ( 50 ) = 0. The maximum product is 625 , achieved when both numbers equal $25$.
Graph of f(x) = x(50-x) showing maximum at x = 25
Graph of f ( x ) = x ( 50 x ) . The maximum occurs at x = 25 .

Find the dimensions of the rectangle of greatest area that can be inscribed in a circle of radius 2.

Solution Inscribe a rectangle $BCDE$ in the circle. Let x = C D . By the Pythagorean theorem, D E = 4 2 x 2 , so the area is A ( x ) = x 16 x 2 , 0 x 4.
Rectangle BCDE inscribed in a circle of radius 2
Setting A'(x)=0: A'(x)=\sqrt{16-x^{2}}-\frac{x^{2}}{\sqrt{16-x^{2}}}=0\Rightarrow16-2x^{2}=0\Rightarrow x=2\sqrt{2}. Comparing values: A ( 0 ) = 0 , A ( 2 2 ) = 8 8 = 8 , A ( 4 ) = 0. The rectangle of maximum area is a **square** with side lengths 2 2 and area $8$.
Graph of A(x) = x*sqrt(16 - x^2) showing maximum at x = 2*sqrt(2)
Graph of A ( x ) = x 16 x 2 .

A piece of cardboard measures 48  in × 18  in . An open box is made by cutting equal squares of side x from each corner and folding up the sides. Find the cut size x that maximizes the volume.

Cardboard with corners cut out, ready to be folded into an open box
Solution After cutting, the box has dimensions 48 2 x , 18 2 x , and x (height):
Diagram showing box dimensions 48-2x by 18-2x by x
V ( x ) = ( 48 2 x ) ( 18 2 x ) x = 4 x 3 132 x 2 + 864 x . The dimensions must be nonnegative, so 0 x 9 . Setting V'(x)=0: V'(x)=12x^{2}-264x+864=12(x^{2}-22x+72)=12(x-4)(x-18)=0 x = 4  or  x = 18. Only x = 4 [ 0 , 9 ] . Comparing values: | x | $0$ | $4$ | $9$ | |-----|-----|------|-----| | V ( x ) | $0$ | $1600$ | $0$ | The maximum volume is 1600   in 3 , obtained when x = 4 in.
Graph of V(x) = (48-2x)(18-2x)x showing maximum at x = 4

What is the shortest distance from the point $(0,2)$ to the parabola 8 x 2 = 2 y ?

Parabola 2y = 8 - x^2 with point (0,2) marked
Solution Any point on the parabola has the form ( x , 1 2 ( 8 x 2 ) ) . The distance from $(0,2)$ to this point is D = x 2 + ( 1 2 ( 8 x 2 ) 2 ) 2 = x 2 + ( 2 1 2 x 2 ) 2 . To avoid differentiating a square root, minimize D 2 : f ( x ) = x 2 + ( 2 1 2 x 2 ) 2 = 1 4 x 4 x 2 + 4. Note: f is even, so we may analyze [ 0 , ) . Setting f'(x)=0: f'(x)=x^{3}-2x=x(x^{2}-2)=0\Rightarrow x=0,\pm\sqrt{2}. Sign diagram for f':
Sign diagram for f'(x) = x(x^2-2)
By the First Derivative Test, x = 0 gives a **local maximum** and x = ± 2 give **local minima**. (The Second Derivative Test fails at x = ± 2 since f''(\pm\sqrt{2})=0.) The minimum distance is D | x = ± 2 = 2 + ( 2 1 ) 2 = 3 . The closest points on the parabola to $(0,2)$ are ( 2 , 3 ) and ( 2 , 3 ) .
Graph of D = sqrt(x^2 + (2 - x^2/2)^2) showing minimum distance at x = ±sqrt(2)

Find the height and radius of the right circular cylinder of maximum volume that can be inscribed in a right circular cone with radius 18  cm and height 30  cm .

Cylinder inscribed in a cone
Solution Let r = radius of the cylinder, h = height of the cylinder, V = volume. **Primary equation:** V = π r 2 h . **Secondary equation (similar triangles):** Looking at the cone from the side, triangles O A B and O'AB' are similar:
Cross-section of cone and inscribed cylinder showing similar triangles
30 h 30 = r 18 h = 30 5 3 r . Substituting: V ( r ) = π r 2 ( 30 5 3 r ) = 30 π r 2 5 3 π r 3 , 0 r 18. Setting V'(r)=0: V'(r)=60\pi r-5\pi r^{2}=5\pi r(12-r)=0\Rightarrow r=0\text{ or }r=12. Comparing values: | r | $0$ | $12$ | $18$ | |-----|-----|------|------| | V | $0$ | 1440 π | $0$ | Maximum volume occurs at r = 12  cm , h = 30 5 3 ( 12 ) = 10  cm .
Graph of V(r) = 30*pi*r^2 - (5/3)*pi*r^3 showing maximum at r = 12

The lower corner of a long page of width a is folded over so as just to reach the inner edge of the page.

(a) Find the width x of the folded part when the length of the crease is a minimum.

(b) Find the width when the area folded over is a minimum.

Page with lower corner folded over to the inner edge
Solution Let x = length of B C , y = length of C E , L = length of the crease B E .
Diagram of folded page with labeled sides
From B C E : L 2 = x 2 + y 2 . Using the geometry of the fold, the constraint between x and y works out to y^{2}=\frac{ax^{2}}{2x-a}.\tag{ii} **(a) Minimize the crease length L .** Substituting (ii) and simplifying: L 2 = x 2 + a x 2 2 x a = 2 x 3 2 x a f ( x ) , x > a 2 . Setting f'(x)=0: f'(x)=\frac{8x^{3}-6ax^{2}}{(2x-a)^{2}}=\frac{2x^{2}(4x-3a)}{(2x-a)^{2}}=0\Rightarrow x=\frac{3a}{4}. Since f'>0 for x > 3 a / 4 and f'<0 for a / 2 < x < 3 a / 4 , by the First Derivative Test x = 3 a / 4 is a **local minimum**. Since L + as x ( a / 2 ) + and as x + , this local minimum is also the absolute minimum. The minimum crease length is L = 2 ( 3 a / 4 ) 3 2 ( 3 a / 4 ) a = 3 3 4 a 1.299 a .
Graph of L/a versus x/a showing minimum at x = 3a/4
**(b) Minimize the folded area A = x y .** Substituting (ii): A = x a x 2 2 x a = a x 4 2 x a g ( x ) , x > a 2 . Minimize g ( x ) = a x 4 2 x a . Setting g'(x)=0: g'(x)=\frac{4ax^{3}(2x-a)-2ax^{4}}{(2x-a)^{2}}=\frac{2ax^{3}(4x-3a-x)}{(2x-a)^{2}}=0\Rightarrow x=\frac{2a}{3}. Check: x = 2 a / 3 ( a / 2 , a ] . The minimum folded area is A | x = 2 a / 3 = 4 a 2 3 3 .
Graph of A/a^2 versus x/a showing minimum at x = 2a/3

Two corridors of widths a and b meet at right angles. What is the maximum length of a ladder that can be carried horizontally around the corner?

Two corridors of widths a and b meeting at right angles, with a ladder being moved around the corner
Solution **Method (a): Cartesian coordinates.**
Diagram of ladder with segments L1 and L2 in the two corridors
The total length of the ladder is L = L 1 + L 2 = x 2 + b 2 + y 2 + a 2 . From the similar-triangle constraint y = a b / x : L = x 2 + b 2 + a x x 2 + b 2 = x 2 + b 2 ( 1 + a x ) . Setting d L / d x = 0 : d L d x = 0 x a b 2 x 2 = 0 x = a b 2 3 . At this critical point: L = ( a 2 / 3 + b 2 / 3 ) 3 / 2 . Since L + as x 0 or x + , the local minimum is the absolute minimum. **Method (b): Trigonometric parametrization.** L ( θ ) = b sin θ + a cos θ , 0 < θ < π 2 . Setting L'(\theta)=0: b cos θ sin 2 θ + a sin θ cos 2 θ = 0 tan 3 θ = b a θ = arctan b a 3 . Using sin ( arctan α ) = α 1 + α 2 and cos ( arctan α ) = 1 1 + α 2 :
Right triangle diagram for sin and cos of arctan(alpha)
Since ϕ = arctan α , draw a right triangle with opposite leg α and adjacent leg $1$; the hypotenuse is 1 + α 2 .
L ( arctan b a 3 ) = ( a 2 / 3 + b 2 / 3 ) 3 / 2 . Both methods confirm: the longest ladder that can be carried around the corner has length 𝑳 = ( 𝒂 2 / 3 + 𝒃 2 / 3 ) 3 / 2 .

Frequently Asked Questions

How do I know whether a critical point gives a maximum or a minimum in an applied problem? Use the First or Second Derivative Test. Alternatively, compare the function values at all critical points and endpoints: the largest is the absolute maximum, the smallest is the absolute minimum. In many applied problems, the physical situation makes the answer obvious, if the function blows up at the boundary of the domain and has a single critical point inside, that critical point must be the absolute extremum.

What if the domain is open (e.g., (0, ∞)) and there are no endpoints? The Extreme Value Theorem does not apply directly. However, if the function approaches + or (or a finite value that is clearly not the extremum) at both ends of the interval, then a local extremum inside the interval is also the absolute extremum.

What is a secondary equation, and why is it needed? The primary equation expresses the quantity to optimize as a function of possibly several variables. A secondary equation is a constraint, a relationship among those variables arising from the geometry or conditions of the problem. Using the constraint to eliminate variables reduces the primary equation to one variable, which can then be optimized with single-variable calculus.