Watch on Instagram

Math Bytes · Calculus · Episode 12 · Applications of derivatives

Optimization

To find the biggest or smallest value of something, write it as a function of one variable, take the derivative, and find where the derivative is zero. With 20 m of fence, the area A = x(10 − x) = 10x − x² peaks where A′ = 10 − 2x = 0, at x = 5: a 5 by 5 square of 25 m².

Posted · About a 1 minute watch, 3 minute read · Take the quiz

The fence problem

You have 20 m of fence and want to enclose the biggest rectangle. Skinny rectangles hold almost nothing; wide ones do better. Which shape is best?

Call the width x. The four sides add to 20:

x + x + (10 − x) + (10 − x) = 20

so the length is 10 − x. The width can be anything between 0 and 10.

Write the function

Area is width times length:

A = x(10 − x) = 10x − x²

Graph it and you get a hill: the area is 0 when x = 0, rises, then falls back to 0 when x = 10.

Set the derivative to zero

At the top of the hill the graph is flat, so the slope (the derivative) is zero there.

A′ = 10 − 2x

10 − 2x = 0 gives x = 5.

So the width is 5 m and the length is 10 − 5 = 5 m: a square, with area 5 × 5 = 25 m². Check a neighbour: 4 × 6 = 24 m², a little less.

The steps for any optimization problem

  1. Name the variable and draw a picture.
  2. Write the function you want to make biggest or smallest, in terms of one variable (use the constraint, like the 20 m of fence, to remove the other one).
  3. Take the derivative and set it equal to 0.
  4. Check it really is the maximum (or minimum): compare with the endpoints, or check the second derivative.

Try it yourself

  1. You have 40 m of fence for a rectangle (all four sides). What's the biggest area?
  2. Two positive numbers add to 14. What's the biggest their product can be?

(Answers: 1. Width x, length 20 − x, A = 20x − x², A′ = 20 − 2x = 0 at x = 10: a 10 by 10 square, 100 m². 2. Product P = x(14 − x) = 14x − x², P′ = 14 − 2x = 0 at x = 7: 7 × 7 = 49.)

Good to know

  • Check that it's a maximum. Here 0 < x < 10, the area is 0 at both ends, and the second derivative A″ = −2 is negative (the graph curves down), so x = 5 is the top, not the bottom.
  • "Slope zero at the top" works for a smooth hilltop inside the allowed range. On a closed interval, the best value can also sit at an endpoint, so compare those too. Lesson 13 covers max and min in more detail.
  • For a fixed perimeter, the rectangle with the most area is always a square.

Answer to the comment question

12 meters of fence makes three sides of a pen, with a wall as the fourth. What's the biggest area? 18 square meters. Let the two sides that touch the wall be x; the side opposite the wall is 12 − 2x. Area A = x(12 − 2x) = 12x − 2x², so A′ = 12 − 4x = 0 gives x = 3. The long side is 12 − 6 = 6, and the area is 3 × 6 = 18 m².

Test your knowledge

Quick quiz: Optimization

4 multiple-choice questions. Pick one answer for each, then check how you did.

1With 20 m of fence and width x, what is the rectangle's length?
2What is the derivative of A = 10x − x²?
3Why do we set the derivative equal to zero to find the biggest area?
4With 20 m of fence, what is the biggest rectangle's area?

Sources

Video transcript

What's the biggest rectangle you can fence with 20 meters of fence?

Call the width x. The four sides add to 20, so the length is 10 minus x.

Area is x times 10 minus x: 10x minus x squared.

At a hilltop, the graph is flat: slope zero. So find where the derivative is zero.

The derivative is 10 minus 2x. That's zero when x is 5.

Five by five: a square, 25 square meters. Four by six gets only 24.

That's optimization: write a function, then find where its derivative is zero.

Your turn. 12 meters of fence makes three sides of a pen, with a wall as the fourth. What's the biggest area? Comment your answer below!

That's your byte.

More from Calculus

All Calculus lessons