Lecture: Section 4.7 — Optimization Problems

Topic 0: The Big Idea

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.

Topic 1: A Strategy for Optimization Problems

These problems can feel overwhelming. The key is to have a systematic plan. Follow these steps every single time.

A 7-Step Strategy for Solving Optimization Problems

  1. Understand the Problem: Read it carefully. What is given? What is unknown? What are you being asked to maximize or minimize?
  2. Draw a Picture: This is the most important step! Label your diagram clearly. Assign variables to all quantities that can change.
  3. Create the Objective Function: Write an equation for the quantity you want to maximize or minimize. This is the "objective." (e.g., $V = \pi r^2 h$ or $A = L \cdot W$). It will often have multiple variables.
  4. Create the Constraint Equation: Find the piece of information (the "constraint") that relates your variables. (e.g., "The volume is 1000 cm³" $\implies 1000 = \pi r^2 h$).
  5. Write the Objective as a Single-Variable Function: Use the constraint equation to solve for one variable and substitute it into the objective function. You should now have a function like $A(r)$ or $P(x)$.
  6. Find the Domain: Determine the feasible, real-world interval for your variable. (e.g., a length $x$ cannot be negative, so $x \ge 0$). This will determine *how* you find the absolute extremum.
  7. Find the Absolute Extremum (The Calculus!):
    • Find the derivative of your function (e.g., $A'(r)$).
    • Find all critical points by setting $A'(r) = 0$.
    • Justify your answer!
      • If your domain is a **closed interval** $[a, b]$: Use the **Closed Interval Method** (check $f(a)$, $f(b)$, and all critical points).
      • If your domain is an **open interval** $(a, b)$: Use the **First or Second Derivative Test for Absolute Extrema** (Topic 3).

Topic 2: Classic Example (Geometry & Fencing)

This first example is a classic. We'll use the Closed Interval Method, which you already know.

Example 2A: The Farmer's Fence

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?

Solution (Following the Strategy):

  1. Understand: We are maximizing Area. We are given 2400 ft of fence.
  2. Draw a Picture: Schematic of a rectangular field bordering a river. The sides perpendicular to the river are labeled 'x' and the side parallel is labeled 'y'.

    Let $x$ be the two sides perpendicular to the river, and $y$ be the side parallel to the river.

  3. Objective Function: We want to maximize Area. $$A = xy$$
  4. Constraint Equation: The fencing is the constraint. We only use 2400 ft. $$2x + y = 2400$$
  5. Single-Variable Function: Solve the constraint for $y$ and plug it into the objective.

    $y = 2400 - 2x$

    $A(x) = x(2400 - 2x) = 2400x - 2x^2$

  6. Domain: What are the feasible values for $x$?
    • $x$ must be positive, so $x \ge 0$.
    • The other side, $y$, must also be positive. Since $y = 2400 - 2x$, we need $2400 - 2x \ge 0 \implies 2400 \ge 2x \implies 1200 \ge x$.
    Our domain is a closed interval: $[0, 1200]$.
  7. Find Absolute Max (Calculus): We can use the Closed Interval Method.

    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:

    • $A(0) = 0$ (endpoint)
    • $A(1200) = 0$ (endpoint)
    • $A(600) = 2400(600) - 2(600)^2 = 1,440,000 - 720,000 = 720,000$
    The maximum area occurs when $x=600$.
  8. Answer: The dimensions are $x = 600$ ft.

    $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.

Topic 3: The Open-Interval Problem & Absolute Extrema Tests

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.

First Derivative Test for Absolute Extrema

Suppose $c$ is the only critical number of a continuous function $f$ on an interval $I$.

  • If $f'(x) < 0$ for all $x < c$ and $f'(x) > 0$ for all $x > c$, then $f(c)$ is the Absolute Minimum of $f$ on $I$. (The function falls, hits its one bottom, and rises forever).
  • If $f'(x) > 0$ for all $x < c$ and $f'(x) < 0$ for all $x > c$, then $f(c)$ is the Absolute Maximum of $f$ on $I$. (The function rises, hits its one peak, and falls forever).

Second Derivative Test for Absolute Extrema

This is often easier. Suppose $c$ is the only critical number of $f$ on an interval $I$.

  • If $f''(c) > 0$ (so $f$ is concave up at $c$), then $f(c)$ is the Absolute Minimum.
  • If $f''(c) < 0$ (so $f$ is concave down at $c$), then $f(c)$ is the Absolute Maximum.

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.

Topic 4: Example (Minimizing Materials)

Let's solve a problem with an open interval domain.

Example 4A: The Soda Can

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?

Solution (Following the Strategy):

  1. Understand: We are minimizing Surface Area. The constraint is that Volume must be 1000 cm³.
  2. Draw a Picture: Schematic of a cylinder, with the radius labeled 'r' and the height labeled 'h'.
  3. Objective Function: Surface Area of a cylinder (top, bottom, and side). $$A = \underbrace{2\pi r^2}_{\text{top/bottom}} + \underbrace{2\pi rh}_{\text{side}}$$
  4. Constraint Equation: Volume of a cylinder. $$V = \pi r^2 h = 1000$$
  5. Single-Variable Function: Solve the constraint for $h$ (it's easier than $r$).

    $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}$$

  6. Domain: The radius $r$ must be positive. It can (theoretically) be infinitely large (making $h$ very small). Our domain is an open interval: $(0, \infty)$.
  7. Find Absolute Min (Calculus): We must use the Extrema Tests from Topic 3.

    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.

  8. Answer: The radius that minimizes cost is $r = \sqrt[3]{500/\pi}$ cm.

    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!

Topic 5: Example (Engineering & Distance)

Example 5A: Closest Point on a Parabola

Problem: Find the point(s) on the parabola $y = 4 - x^2$ that are closest to the point $(0, 2)$.

Solution (Following the Strategy):

  1. Understand: We are minimizing Distance.
  2. Draw a Picture:

    This Desmos graph shows the setup: the parabola, the point (0,2), and the distance to a movable point (x,y) on the curve.

  3. Objective Function: The distance formula. $$D = \sqrt{(x-0)^2 + (y-2)^2} = \sqrt{x^2 + (y-2)^2}$$

    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$.

  4. Constraint Equation: The point $(x,y)$ must be on the parabola. $$y = 4 - x^2$$
  5. Single-Variable Function: Substitute $y$ into our new objective $f$.

    $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$$
  6. Domain: The parabola $y = 4 - x^2$ extends forever in the $x$-direction. Our domain is $(-\infty, \infty)$.
  7. Find Absolute Min (Calculus):

    $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:

    • A local min at $x = -\sqrt{3/2}$
    • A local max at $x = 0$
    • A local min at $x = \sqrt{3/2}$

    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}$

    Since $\frac{7}{4} < 4$, the absolute minimum value is $7/4$, and it occurs at $x = \pm \sqrt{3/2}$.
  8. Answer: The $x$-coordinates are $x = \pm \sqrt{3/2}$.

    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)$.

Topic 6: Example (Economics)

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.

Example 6A: Maximizing Profit

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.

Solution:

  1. Goal: Maximize Profit. We can do this by setting $R'(x) = C'(x)$.
  2. Find Revenue $R(x)$:

    $R(x) = x \cdot p(x) = x(150 - 0.5x) = 150x - 0.5x^2$

  3. Find Marginals (Derivatives):

    Marginal Revenue: $R'(x) = 150 - x$

    Marginal Cost: $C'(x) = 0.5x$

  4. Set Marginals Equal:

    $150 - x = 0.5x$

    $150 = 1.5x$

    $x = 100$

  5. Justify: We must check this is a max. We can find the Profit function $P(x)$ and use the 2nd Derivative Test.

    $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.
  6. Answer: A production level of 100 units will maximize profit.

Topic 7: Check Your Understanding

Check Your Understanding: The Box Problem

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?

  1. Draw a Picture:

  2. Objective Function: We want to maximize Volume.

    $V = L \cdot W \cdot H$

  3. Constraint/Single-Variable: The dimensions all depend on the cutout $x$.
    • The height is the size of the fold: $H = x$
    • The length is $12$ minus two cutouts: $L = 12 - 2x$
    • The width is also $12$ minus two cutouts: $W = 12 - 2x$

    Objective Function: $V(x) = (12 - 2x)(12 - 2x)(x) = x(144 - 48x + 4x^2)$
    $V(x) = 4x^3 - 48x^2 + 144x$

  4. Domain:
    • $x$ must be positive: $x \ge 0$.
    • The sides $12-2x$ must be positive: $12 - 2x \ge 0 \implies 12 \ge 2x \implies 6 \ge x$.
    Our domain is a closed interval: $[0, 6]$.
  5. Find Absolute Max (Calculus): We can use the Closed Interval Method.

    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]$:

    • $V(0) = 0$ (endpoint)
    • $V(6) = 0$ (critical point and endpoint)
    • $V(2) = 4(2)^3 - 48(2)^2 + 144(2) = 4(8) - 48(4) + 288 = 32 - 192 + 288 = 128$
    The maximum volume is 128.
  6. Answer: The maximum volume of 128 in³ occurs when the side length of the cut-out squares is $x=2$ inches.

Lecture Conclusion

What You Should Have Learned

  • How to translate a "story problem" into a mathematical framework consisting of an objective function and a constraint equation.
  • The 7-step strategy for solving any optimization problem (Draw, Objective, Constraint, Single-Variable, Domain, Calculus, Answer).
  • The critical importance of finding the domain of your function.
  • How to find and justify an absolute extremum based on the domain:
    • For a Closed Interval $[a,b]$, use the Closed Interval Method (test endpoints and CPs).
    • For an Open Interval $(a,b)$, use the 1st or 2nd Derivative Tests for Absolute Extrema (check the behavior at your single critical point).