In Chapter 4 so far, we have focused on finding the maximum or minimum of a function that was given to us. For example, "Find the local extrema of $f(x) = x^3 - 3x$."
In this section, we tackle a much more powerful and realistic type of problem. We will be given a "story" or a real-world situation, and our first (and hardest) job will be to build the function ourselves.
We are looking for the "best" solution: the cheapest price, the strongest beam, the largest volume, the shortest time. These are all words that mean we need to find a maximum or a minimum.
The core challenge of optimization is not the calculus (which is just $f'(x)=0$), but translating a word problem into a mathematical function.
These problems can feel overwhelming. The key is to have a systematic plan. Follow these steps every single time.
This first example is a classic. We'll use the Closed Interval Method, which you already know.
Problem: A farmer has 2400 ft of fencing and wants to fence off a rectangular field that borders a straight river. He needs no fence along the river. What are the dimensions of the field that has the largest possible area?
Let $x$ be the two sides perpendicular to the river, and $y$ be the side parallel to the river.
$y = 2400 - 2x$
$A(x) = x(2400 - 2x) = 2400x - 2x^2$
First, find critical points. $A'(x) = 2400 - 4x$
Set $A'(x) = 0 \implies 2400 - 4x = 0 \implies 4x = 2400 \implies x = 600$.
Now, test the critical point and the endpoints:
$y = 2400 - 2(600) = 2400 - 1200 = 1200$ ft.
The field should be 600 ft (perpendicular to the river) by 1200 ft (parallel to the river) for a max area of 720,000 sq ft.
What if the domain is not a closed interval? For example, what if the domain is $(0, \infty)$? We can't check the "endpoints" because there are none. We need a new tool.
Suppose $c$ is the only critical number of a continuous function $f$ on an interval $I$.
This is often easier. Suppose $c$ is the only critical number of $f$ on an interval $I$.
Warning: This test is only useful if $f''(x)$ has the same sign on the whole interval. If $f$ is concave up *everywhere* on $I$, then its single critical point *must* be the absolute minimum.
Let's solve a problem with an open interval domain.
Problem: We need to manufacture a cylindrical can that holds 1 Liter (1000 cm³) of liquid. What dimensions (radius $r$ and height $h$) will minimize the amount of metal (the surface area) used?
$h = \frac{1000}{\pi r^2}$
Substitute into $A$: $A(r) = 2\pi r^2 + 2\pi r \left( \frac{1000}{\pi r^2} \right)$ $$A(r) = 2\pi r^2 + \frac{2000}{r}$$
First, find critical points. $A'(r) = 4\pi r - \frac{2000}{r^2}$
Set $A'(r) = 0 \implies 4\pi r = \frac{2000}{r^2} \implies 4\pi r^3 = 2000$ $$r^3 = \frac{2000}{4\pi} = \frac{500}{\pi}$$ $$r = \sqrt[3]{\frac{500}{\pi}} \approx 5.42 \text{ cm}$$
This is our only critical point on the interval $(0, \infty)$. Let's use the Second Derivative Test to justify it's a min. $$A''(r) = 4\pi + \frac{4000}{r^3}$$
On our domain $(0, \infty)$, $r$ is always positive. Therefore, $A''(r)$ is always positive.
Since the function $A(r)$ is always concave up on its domain, its single critical point must be an absolute minimum.
Now find the height $h$: $h = \frac{1000}{\pi r^2} = \frac{1000}{\pi (500/\pi)^{2/3}} = \frac{2 \cdot 500}{\pi \cdot \pi^{-2/3} \cdot 500^{2/3}} = \frac{2 \cdot 500^{1/3}}{\pi^{1/3}} = 2 \sqrt[3]{\frac{500}{\pi}}$
Notice that $h = 2r$. The most efficient can has a height equal to its diameter!
Problem: Find the point(s) on the parabola $y = 4 - x^2$ that are closest to the point $(0, 2)$.
This Desmos graph shows the setup: the parabola, the point (0,2), and the distance to a movable point (x,y) on the curve.
Pro Tip: Minimizing the distance $D$ is the same as minimizing the square of the distance, $D^2$. This lets us avoid the messy square root!
Our new objective is: $f = D^2 = x^2 + (y-2)^2$.
$f(x) = x^2 + ( (4-x^2) - 2 )^2$
$f(x) = x^2 + (2 - x^2)^2 = x^2 + (4 - 4x^2 + x^4)$
$$f(x) = x^4 - 3x^2 + 4$$$f'(x) = 4x^3 - 6x = 2x(2x^2 - 3)$
Set $f'(x) = 0 \implies 2x = 0$ or $2x^2 - 3 = 0$.
This gives three critical points: $x = 0$, $x = \sqrt{3/2}$, and $x = -\sqrt{3/2}$.
Since we have more than one critical point, the 2nd Derivative Test for Absolute Extrema isn't the best tool. We must use the First Derivative Test (a sign chart for $f'(x)$) to see what's happening.
Sign chart for $f'(x) = 2x(2x^2 - 3)$:
Interval $(-\infty, -\sqrt{3/2})$: Test $x=-2 \implies 2(-)(+) = -$. Decreasing.
Interval $(-\sqrt{3/2}, 0)$: Test $x=-1 \implies 2(-)(-) = +$. Increasing.
Interval $(0, \sqrt{3/2})$: Test $x=1 \implies 2(+)(-) = -$. Decreasing.
Interval $(\sqrt{3/2}, \infty)$: Test $x=2 \implies 2(+)(+) = +$. Increasing.
From the chart, we have:
The absolute minimum must be at one of the two local minimums. Let's check their values (since $f(x)$ is even, they will be the same):
$f(0) = 0^4 - 3(0)^2 + 4 = 4$
$f(\sqrt{3/2}) = (\sqrt{3/2})^4 - 3(\sqrt{3/2})^2 + 4 = \frac{9}{4} - 3\left(\frac{3}{2}\right) + 4 = \frac{9}{4} - \frac{9}{2} + 4 = \frac{9}{4} - \frac{18}{4} + \frac{16}{4} = \frac{7}{4}$
The $y$-coordinate is $y = 4 - x^2 = 4 - (\sqrt{3/2})^2 = 4 - 3/2 = 5/2$.
The two closest points are $\left(-\sqrt{\frac{3}{2}}, \frac{5}{2}\right)$ and $\left(\sqrt{\frac{3}{2}}, \frac{5}{2}\right)$.
Optimization is the heart of business and economics. The key is to know the vocabulary.
To maximize profit, we find $P'(x)$ and set it to 0. $$P'(x) = R'(x) - C'(x)$$ $$0 = R'(x) - C'(x) \implies \boxed{R'(x) = C'(x)}$$
In economics, $R'(x)$ is called **Marginal Revenue** and $C'(x)$ is called **Marginal Cost**.
Profit is maximized when Marginal Revenue equals Marginal Cost.
Problem: A company's cost to produce $x$ units is $C(x) = 4000 + 0.25x^2$. The price function is $p(x) = 150 - 0.5x$. Find the production level $x$ that will maximize profit.
$R(x) = x \cdot p(x) = x(150 - 0.5x) = 150x - 0.5x^2$
Marginal Revenue: $R'(x) = 150 - x$
Marginal Cost: $C'(x) = 0.5x$
$150 - x = 0.5x$
$150 = 1.5x$
$x = 100$
$P(x) = R(x) - C(x) = (150x - 0.5x^2) - (4000 + 0.25x^2)$
$P(x) = -0.75x^2 + 150x - 4000$
$P'(x) = -1.5x + 150$ (Setting this to 0 gives $x=100$, which matches.)
$P''(x) = -1.5$
Since the second derivative is always negative, the profit function is always concave down. This means our single critical point at $x=100$ must be the absolute maximum.Problem: You have a 12" by 12" square piece of cardboard. You want to make an open-top box by cutting out identical squares of side length $x$ from each of the four corners and folding up the sides. What value of $x$ will produce a box with the maximum possible volume?
$V = L \cdot W \cdot H$
Objective Function: $V(x) = (12 - 2x)(12 - 2x)(x) = x(144 - 48x + 4x^2)$
$V(x) = 4x^3 - 48x^2 + 144x$
First, find critical points.
$V'(x) = 12x^2 - 96x + 144$
$V'(x) = 12(x^2 - 8x + 12)$
$V'(x) = 12(x-2)(x-6)$
Critical points are $x=2$ and $x=6$.
Now, test the critical points and the endpoints $[0, 6]$: