Back to courseLesson 7 of 15

Optimization

What you'll learn

Turn a real-world 'largest' or 'smallest' question into a derivative set equal to zero.

Here's calculus earning its keep. "What's the largest, cheapest, fastest, or smallest?" is a question about a maximum or minimum — and you already know those live where the derivative is zero.

The best point has a flat tangent

xAA′(x) = 0x = 10100
The most area from a fixed fence: A(x) = x(20 − x) peaks where its slope is flat — A′(x) = 0. Setting the derivative to zero is how every “largest” or “smallest” problem is solved.

At a maximum or minimum, the curve stops rising and hasn't yet started falling (or vice versa), so its tangent is momentarily flat: the derivative is zero. Optimization is the art of writing the quantity you care about as a function, then solving f′ = 0.

The recipe

  1. Name the quantity to optimize and write it as a function.
  2. Reduce to one variable, using any constraint to eliminate the others.
  3. Differentiate and set to zero to find the critical points.
  4. Confirm it's a max or min (second-derivative test or endpoints), and answer the question asked.

Worked example

You have 40 m of fencing for a rectangular pen against no wall. Maximize the area.

  • Perimeter constraint: 2x + 2y = 40, so y = 20 − x.
  • Area as one variable: A(x) = x(20 − x) = 20x − x².
  • Differentiate and solve: A′(x) = 20 − 2x = 0 → x = 10.
  • Then y = 10, and A″(x) = −2 < 0 confirms a maximum.

The best pen is a 10 × 10 square with area 100 m² — the graph above peaks exactly there.

Why this matters

Optimization is the most directly useful thing calculus does: minimizing material in packaging, maximizing range on a tank of fuel, finding the least-cost production level. Every one reduces to the same move — set the derivative to zero.

Check your understanding

Question 1 of 2

To find the value of x that maximizes a quantity Q(x), you solve:

Next lesson