Chapter 3 · Applications of Derivatives

3.6 Optimization

Largest area, biggest box, fastest route — model the quantity as a function of one variable on a sensible domain, then find its extremum.

A common application of calculus is finding the largest or smallest value of a quantity: companies minimize costs and maximize revenue; manufacturers minimize the material needed to package a given volume. Here we set up such problems and solve them with the tools of this chapter.

Solving Optimization Problems over a Closed, Bounded Interval

Every problem has the same shape: a quantity to maximize or minimize, and an auxiliary condition (a constraint) that must be satisfied. Without the constraint the answer would often be "as big as you like".

✏️ Example 1 — Maximizing the area of a garden
A rectangular garden uses a rock wall as one side and wire fencing for the other three. Given $100$ ft of fencing, find the dimensions that give the maximum area, and the maximum area.
Variables Let $x$ be the side perpendicular to the wall and $y$ the side parallel to it. Area $A=xy$.
Constraint The fencing covers $2x+y=100$, so $y=100-2x$ and $$A(x)=x(100-2x)=100x-2x^2.$$
Domain We need $x>0$ and $y>0$, so $0<x<50$. Consider $A$ on the closed interval $[0,50]$, where the Extreme Value Theorem guarantees a maximum.
Optimize $A(0)=A(50)=0$, while $A>0$ inside, so the maximum is at a critical point: $A^\prime(x)=100-4x=0\Rightarrow x=25$. Then $y=50$.
Answer $x=25$ ft, $y=50$ ft, maximum area $1250\ \text{ft}^2$.
Checkpoint With $200$ ft of fencing: $A(x)=200x-2x^2$, $x=50$, $y=100$, maximum area $5000\ \text{ft}^2$.
🧭 Problem-Solving Strategy — Solving optimization problems
  1. Introduce all variables. If applicable, draw a figure and label it.
  2. Determine which quantity is to be maximized or minimized, and for what range of the other variables.
  3. Write a formula for that quantity in terms of the variables.
  4. Use the equations relating the variables (the constraints) to write the quantity as a function of one variable.
  5. Identify the domain of that function from the physical problem.
  6. Locate the maximum or minimum — usually by finding critical points and evaluating at endpoints.
Interactive 1 — Optimization Lab

Drag $x$. The left panel shows the actual garden, box or route; the right panel plots the quantity being optimized. The optimum is where the graph peaks or bottoms out — the derivative is zero there.

the physical set-up
the objective as a function of $x$
✏️ Example 2 — Maximizing the volume of a box
An open-top box is made from a $24$ in by $36$ in piece of cardboard by removing a square from each corner and folding up the flaps. What size square should be cut out to get the maximum volume?
Step 1–3 Let $x$ be the side of the square removed. Maximize $V=LWH$.
Step 4 Height $x$, length $36-2x$, width $24-2x$: $$V(x)=(36-2x)(24-2x)x=4x^3-120x^2+864x.$$
Step 5 We need $0<x<12$ (half the shorter side), so consider $[0,12]$.
Step 6 $V=0$ at both ends, so the maximum is at a critical point. $V^\prime(x)=12x^2-240x+864=0\Rightarrow x^2-20x+72=0\Rightarrow x=10\pm2\sqrt7$. Only $10-2\sqrt7\approx4.71$ lies in $(0,12)$.
Answer Cut squares of side $x=10-2\sqrt7\approx4.71$ in. Maximum volume $V=640+448\sqrt7\approx1825\ \text{in}^3$.
✏️ Example 3 — Minimizing travel time
An island is $2$ mi due north of its closest point on a straight shoreline. A cabin is on the shore $6$ mi west of that point. The visitor runs at $8$ mph and swims at $3$ mph. How far should the visitor run before swimming, to minimize the total time?
Step 1–3 Let $x$ be the running distance and $y$ the swimming distance. Time $=\dfrac{\text{distance}}{\text{rate}}$, so $T=\dfrac{x}{8}+\dfrac{y}{3}$.
Step 4 The swim is the hypotenuse of a right triangle with legs $2$ and $6-x$: $y=\sqrt{(6-x)^2+4}$, so $$T(x)=\frac x8+\frac{\sqrt{(6-x)^2+4}}{3}.$$
Step 5 Domain: $0\le x\le6$.
Step 6 $T^\prime(x)=\dfrac18-\dfrac{6-x}{3\sqrt{(6-x)^2+4}}=0\Rightarrow3\sqrt{(6-x)^2+4}=8(6-x)$. Squaring: $9\left[(6-x)^2+4\right]=64(6-x)^2\Rightarrow55(6-x)^2=36\Rightarrow x=6\pm\dfrac{6}{\sqrt{55}}$. Only $x=6-\dfrac{6}{\sqrt{55}}\approx5.19$ lies in $[0,6]$, and it satisfies the unsquared equation.
Compare $T(0)\approx2.108$ h, $T(6)\approx1.417$ h, $T\left(6-\tfrac{6}{\sqrt{55}}\right)\approx1.368$ h. The minimum time comes from running about $5.19$ mi, then swimming.

Exercises

I
Set up and evaluate each optimization problem.
  • 1 You are constructing a cardboard box from a $2$ m by $4$ m sheet. You cut equal-size squares from each corner so you may fold the edges. What are the dimensions of the box with the largest volume?
  • 2 Find the positive integer that minimizes the sum of the number and its reciprocal.
  • 3 Find two positive integers such that their sum is $10$, and minimize and maximize the sum of their squares.
Try it
the physical set-up
the objective as a function of $x$
1 Cut $x$: $V(x)=(4-2x)(2-2x)x=4x^3-12x^2+8x$ on $[0,1]$. $V^\prime=12x^2-24x+8=0\Rightarrow x^2-2x+\tfrac23=0\Rightarrow x=1-\tfrac{1}{\sqrt3}\approx0.423$ m (the other root exceeds $1$). Dimensions: height $\approx0.423$ m, length $4-2x=2+\tfrac{2}{\sqrt3}\approx3.155$ m, width $2-2x=\tfrac{2}{\sqrt3}\approx1.155$ m; volume $\tfrac{8\sqrt3}{9}\approx1.540\ \text{m}^3$.
2 $f(n)=n+\dfrac1n$, $f^\prime(n)=1-\dfrac{1}{n^2}=0$ at $n=1$, and $f$ increases for $n>1$. The integer is $n=1$, with sum $2$.
3 Let $x+y=10$, $S(x)=x^2+(10-x)^2$, $S^\prime=4x-20=0\Rightarrow x=5$. With positive integers $x\in\{1,\dots,9\}$: the minimum is $5+5$, giving $S=50$; the maximum is at the ends, $1+9$, giving $S=82$.
II
Consider the construction of a pen to enclose an area.
  • 1 You have $400$ ft of fencing to construct a rectangular pen for cattle. What dimensions maximize the area?
  • 2 You have $800$ ft of fencing to make a pen for hogs. If a river forms one side, what dimensions of the rectangular pen maximize the area?
  • 3 You need to fence a rectangular area of $1600\ \text{ft}^2$. What dimensions minimize the amount of fencing?
Try it
the physical set-up
the objective as a function of $x$
1 $2x+2y=400\Rightarrow y=200-x$, $A=x(200-x)$, $A^\prime=200-2x=0\Rightarrow x=100$. A $100\times100$ ft square, area $10\,000\ \text{ft}^2$.
2 $2x+y=800$, $A=x(800-2x)$, $A^\prime=800-4x=0\Rightarrow x=200$, $y=400$. Pen $200$ ft (perpendicular to the river) by $400$ ft (along it); area $80\,000\ \text{ft}^2$.
3 $xy=1600\Rightarrow y=\dfrac{1600}{x}$; fencing $P=2x+\dfrac{3200}{x}$, $P^\prime=2-\dfrac{3200}{x^2}=0\Rightarrow x=40$. A $40\times40$ ft square, using $160$ ft of fencing.
III
Classic geometric optimization. For each problem, write the objective as a function of one variable, state its domain, find the critical point and confirm it gives the optimum.
  • 1 A farmer has $600$ m of fencing to enclose a rectangular field and divide it into three equal pens with two fences parallel to one side. What dimensions maximize the total area?
  • 2 An open-top box with a square base must hold $32\,000\ \text{cm}^3$. Find the dimensions that use the least material.
  • 3 A closed cylindrical can must hold $500\ \text{cm}^3$. Find the radius and height that minimize its surface area.
  • 4 Find the point on the curve $y=\sqrt x$ closest to the point $(3,0)$.
  • 5 A Norman window is a rectangle topped by a semicircle. If its perimeter is $8$ m, what dimensions let in the most light (largest area)?
Try it
the physical set-up
the objective as a function of $x$
1 Let $x$ be the length of each of the four parallel fences and $y$ the other side. $4x+2y=600\Rightarrow y=300-2x$, so $A(x)=x(300-2x)=300x-2x^2$ on $[0,150]$. $A^\prime=300-4x=0\Rightarrow x=75$, $y=150$. $A(0)=A(150)=0$, so the maximum is $A=75\cdot150=11\,250\ \text{m}^2$.
2 Base side $x$, height $h$: $x^2h=32\,000\Rightarrow h=\dfrac{32\,000}{x^2}$. Material $S=x^2+4xh=x^2+\dfrac{128\,000}{x}$, $x>0$. $S^\prime=2x-\dfrac{128\,000}{x^2}=0\Rightarrow x^3=64\,000\Rightarrow x=40$ cm, $h=20$ cm. $S^{\prime\prime}=2+\dfrac{256\,000}{x^3}>0$, so this is a minimum: $S=1600+3200=4800\ \text{cm}^2$.
3 $\pi r^2h=500\Rightarrow h=\dfrac{500}{\pi r^2}$. $S=2\pi r^2+2\pi rh=2\pi r^2+\dfrac{1000}{r}$, $r>0$. $S^\prime=4\pi r-\dfrac{1000}{r^2}=0\Rightarrow r^3=\dfrac{250}{\pi}\Rightarrow r=\sqrt[3]{250/\pi}\approx4.301$ cm. Then $h=\dfrac{500}{\pi r^2}=\dfrac{2\pi r^3}{\pi r^2}=2r\approx8.603$ cm, and $S=6\pi r^2\approx348.7\ \text{cm}^2$. The best can is as tall as it is wide.
4 Minimize the squared distance $D(x)=(x-3)^2+(\sqrt x)^2=x^2-5x+9$, $x\ge0$. $D^\prime=2x-5=0\Rightarrow x=\tfrac52$ ($D$ is an upward parabola, so this is the minimum). The point is $\left(\tfrac52,\sqrt{\tfrac52}\right)\approx(2.5,1.581)$, at distance $\sqrt{9-\tfrac{25}{4}}=\dfrac{\sqrt{11}}{2}\approx1.658$.
5 Let $r$ be the radius (so the width is $2r$) and $h$ the rectangle's height. $2r+2h+\pi r=8\Rightarrow h=\dfrac{8-(2+\pi)r}{2}$. $A=2rh+\tfrac12\pi r^2=8r-\left(2+\tfrac\pi2\right)r^2$ on $\left[0,\tfrac{8}{2+\pi}\right]$. $A^\prime=8-(4+\pi)r=0\Rightarrow r=\dfrac{8}{4+\pi}\approx1.120$ m, and then $h=\dfrac{8}{4+\pi}=r$. Width $\dfrac{16}{4+\pi}\approx2.240$ m, rectangle height $\approx1.120$ m, maximum area $\dfrac{32}{4+\pi}\approx4.481\ \text{m}^2$.
IV
Business, travel and a few traps.
  • 1 Revenue. A shop finds that it sells $x$ units per week when the price is $p=60-0.02x$ OMR. What price maximizes weekly revenue, and what is the maximum revenue?
  • 2 Profit. A company's cost is $C(x)=2000+10x+0.01x^2$ OMR and its demand is $p=50-0.01x$. How many units maximize profit, and what is the maximum profit?
  • 3 Shortest time. A woman is on one bank of a straight river $1$ km wide. She wants to reach a point on the opposite bank $3$ km downstream. She can row at $4$ km/h and walk at $5$ km/h. Where should she land to minimize her travel time?
  • 4 Find the points on the parabola $y=x^2$ closest to $(0,2)$.
  • 5 Find the largest rectangle that can be inscribed in a semicircle of radius $5$, with one side on the diameter.
  • 6 Conceptual. A student maximizes $f(x)=x^3-3x$ over $[0,3]$: "$f^\prime(x)=3x^2-3=0$ at $x=1$, so the maximum is at $x=1$." Find the mistake and the correct maximum.
1 $R(x)=xp=60x-0.02x^2$ on $[0,3000]$. $R^\prime=60-0.04x=0\Rightarrow x=1500$ units, so $p=60-30=30$ OMR. $R^{\prime\prime}=-0.04<0$: maximum revenue $R=1500\cdot30=45\,000$ OMR per week.
2 $P(x)=R-C=(50x-0.01x^2)-(2000+10x+0.01x^2)=40x-0.02x^2-2000$. $P^\prime=40-0.04x=0\Rightarrow x=1000$ units ($P^{\prime\prime}=-0.04<0$). Maximum profit $P(1000)=40\,000-20\,000-2000=18\,000$ OMR, at price $p=40$ OMR.
3 Land $x$ km downstream, then walk $3-x$: $T(x)=\dfrac{\sqrt{1+x^2}}{4}+\dfrac{3-x}{5}$ on $[0,3]$. $T^\prime=\dfrac{x}{4\sqrt{1+x^2}}-\dfrac15=0\Rightarrow5x=4\sqrt{1+x^2}\Rightarrow25x^2=16+16x^2\Rightarrow x=\tfrac43$ km. Compare: $T(0)=0.85$ h, $T(3)=\tfrac{\sqrt{10}}{4}\approx0.791$ h, $T\!\left(\tfrac43\right)=\tfrac{5/3}{4}+\tfrac{5/3}{5}=\tfrac{5}{12}+\tfrac13=\tfrac34$ h. Land $\tfrac43$ km downstream; the trip takes $45$ minutes.
4 $D(x)=x^2+(x^2-2)^2=x^4-3x^2+4$. $D^\prime=4x^3-6x=2x(2x^2-3)=0\Rightarrow x=0$ or $x=\pm\sqrt{\tfrac32}$. $D(0)=4$ but $D\!\left(\pm\sqrt{3/2}\right)=\tfrac94-\tfrac92+4=\tfrac74$. The closest points are $\left(\pm\sqrt{\tfrac32},\tfrac32\right)$ at distance $\dfrac{\sqrt7}{2}\approx1.323$; the critical point $x=0$ is a local maximum of $D$.
5 Corner at $\left(x,\sqrt{25-x^2}\right)$: $A(x)=2x\sqrt{25-x^2}$ on $[0,5]$. $A^\prime=2\sqrt{25-x^2}-\dfrac{2x^2}{\sqrt{25-x^2}}=\dfrac{2(25-2x^2)}{\sqrt{25-x^2}}=0\Rightarrow x=\dfrac{5}{\sqrt2}$. The rectangle is $5\sqrt2\approx7.071$ wide and $\dfrac{5}{\sqrt2}\approx3.536$ tall, with area $25$ (and $A=0$ at both endpoints).
6 The student never tested the endpoints or the type of the critical point. $f(0)=0$, $f(1)=-2$, $f(3)=27-9=18$. $x=1$ is actually the minimum; the maximum on $[0,3]$ is $18$, at the endpoint $x=3$. On a closed interval always compare $f$ at critical points and endpoints.
🔬 Research–Teaching NexusResearch-led · optional, about 30 minutes

Research question. Are real cans shaped to use the least metal, i.e. is $h=2r$?

Why it matters. Packaging engineers optimise shape for material cost, strength, shelf space and grip; comparing theory with real products is a common industrial study.

What to do.

  1. For a closed cylinder of volume $V$, show that the surface area $S=2\pi r^2+\frac{2V}{r}$ is smallest when $h=2r$.
  2. Measure the height and diameter of three or more real cans (soft drink, tuna, laban, tomato paste).
  3. Compute $\frac{h}{r}$ for each and compare with $2$.
  4. Compute the extra metal used compared with the optimal can of the same volume.

Tools: Ruler, calculator or spreadsheet

Hand in: A half-page note: your table of cans, the percentage of extra metal, and one reason why the manufacturer chose that shape.

Going further. Anywhere: measure cans in any shop and compare brands.

Instructor note: Students should notice that most cans are not optimal; reasons include thicker ends, easy holding, stacking and appearance.

🧪 Self-check quiz

0/5 correct

Q1. The garden with $100$ ft of fencing and a wall has maximum area when $x=$

Q2. In Example 2, why is $10+2\sqrt7$ rejected?

Q3. Why can we study $A(x)$ on $[0,50]$ rather than $(0,50)$?

Q4. For a fixed perimeter, the rectangle of largest area is:

Q5. Squaring both sides of an equation when finding critical points can: