Achievable logoAchievable logo
AP Calculus AB
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Limits
2. Derivative basics
3. Advanced differentiation
4. Contextual uses
5. Analytical uses
5.1 Important theorems
5.2 1st derivative test
5.3 2nd derivative test
5.4 Graphs & curve sketching
5.5 Optimization
6. Integration
7. Differential equations
8. Applications of integrals
9. Testing details tag
Wrapping up
Achievable logoAchievable logo
5.5 Optimization
Achievable AP Calculus AB
5. Analytical uses
Our AP Calculus AB course is currently in development and is a work-in-progress.

Optimization

9 min read
Font
Discuss
Share
Feedback

What you’ll learn:

  • How to recognize optimization problems by key words
  • Solve optimization problems in real-world contexts, including geometry and motion
  • Distinguishing optimization and related rates problems

Optimization means finding the maximum or minimum value of a quantity while meeting certain constraints. It’s a common real-world application of derivative tests. You can usually spot an optimization problem by key words like maximum/minimum or largest/greatest/smallest/least.

General strategy

The following example will be a reference for the step-by-step process:

  1. What is the minimum perimeter of a rectangle that has an area of 16 m2?

1. Identify the objective function to optimize (what you’re trying to maximize or minimize).

The goal is to minimize the perimeter of the rectangle. Let the dimensions be L (length) and W (width). The objective function is

P=2L+2W

2. Determine the constraint equation(s).

The rectangle is constrained by its area, which must be 16 m2. So the constraint equation is

A=L×W

16=L×W

3. Rewrite the objective function in terms of a single variable.

Do this by using the constraint to substitute for one variable in the objective function. It usually doesn’t matter which variable you choose. (If the question asked for the length that minimizes the perimeter, rewriting everything in terms of L would save a step.)

Rearrange the constraint equation:

W=L16​

Now substitute into the perimeter formula:

P(L)=2L+2W

=2L+L32​

4. Find the extrema of the objective function

To find where the perimeter is minimized, find the critical point(s) of P(L) (values of L where P′(L)=0 or where P′(L) is undefined). Differentiate:

P′(L)=2−L232​

Solve P′(L)=0:

2−L232​=0

2=L232​

L2=16

L=±4

Because L represents a length, we restrict to L>0. So the only meaningful critical point is L=4.

Now decide whether L=4 gives a maximum or a minimum. You can use either the 1st derivative test or the 2nd derivative test.

1st derivative test:

Test intervals around L=4. The domain is L>0.

Interval Sign of P′(L) P(L) behavior
(0,4) − ↘
(4,∞) + ↗

Because P′(L) changes from negative to positive, P(L) has a local minimum at L=4.

2nd derivative test:

Start with

P′(L)=2−L232​

Differentiate again:

P′′(L)=L364​

For L>0, we have P′′(L)>0, so P(L) is concave up on its domain. That means the critical point L=4 gives a local minimum, matching the 1st derivative test.

The question asks for the minimum perimeter, so evaluate P at L=4:

P(4)=2(4)+432​

=16 m​

Sidenote
Not related rates

Optimization problems involve maximizing or minimizing quantities, while related rates problems involve quantities that change with respect to time (often requiring implicit differentiation). Be sure not to confuse the two.

Even though optimization problems aren’t related rates problems, time can still be the input variable. The next problem changes over time, but it’s still optimization because the goal is to minimize a function, not to find a rate.

  1. Boat Achievable is due west of Boat Calculus a distance of 10 km away. Boat Achievable starts heading east at 3 km/hr at the same time that Boat Calculus heads north at 4 km/hr. At what time are the two boats closest together? What is the distance between them at this time?

Solution

(spoiler)

1. Identify the objective function to optimize

The goal is to find when the distance between the two boats is as small as possible.

Place the boats on a coordinate plane. Let Boat Calculus start at (0,0) and Boat Achievable start at (−10,0).

Since distance = rate × time, the position of Boat Calculus at time t is

(0,4t)

and the position of Boat Achievable at time t is

(−10+3t,0)

Use the distance formula (from the Pythagorean theorem). The distance between the boats is

D(t)=(0−(−10+3t))2+(4t−0)2​

=(10−3t)2+16t2​

=100−60t+25t2​

Minimizing D(t) is equivalent to minimizing D(t)2, and the squared version avoids the square root. So we’ll minimize

f(t)=100−60t+25t2,t≥0.

2. Determine the constraint equation(s).

Unlike the rectangle problem, there’s no fixed constraint equation here. The motion of each boat is already built into the position formulas.

3. Rewrite the objective function in terms of a single variable.

The objective function is already in terms of one variable, t.

4. Find the extrema of the objective function

Differentiate f(t):

f′(t)=−60+50t

Solve f′(t)=0:

−60+50t=0

50t=60

t=56​=1.2

Use the 2nd derivative test:

f′′(t)=50

Since f′′(t)>0, f(t) is concave up and has a relative minimum at t=1.2. Because f(t)=D(t)2, minimizing f(t) also minimizes D(t).

So the boats are closest after

1.2 hours​.

Now find the minimum distance:

D(1.2)=100−60(1.2)+25(1.2)2​

=8 km​

For some optimization problems, you also have to consider additional limitations. In those cases, you’ll test endpoints of an interval using the extreme value theorem.

  1. You have a piece of wire 10 meters long and need to form a circle and/or a square. You can use the entire wire for a single shape or cut it and bend each piece into one of each shape. How should the wire be allocated to:
    a) Maximize the total enclosed area?
    b) Minimize the total enclosed area?

Solution

(spoiler)

1. Identify the objective function to optimize

The goal is to optimize the total enclosed area.

Define variables: let the side length of the square bes, and let each side of the equilateral triangle be t.

The area of the square is s2.

The area of the equilateral triangle is 43​​t2.

So the total area is

A=s2+43​​t2

2. Determine the constraint equation(s).

The 10-meter wire becomes the sum of the perimeters.

The perimeter of the square is 4s.

The perimeter of the equilateral triangle is 3t.

So the constraint equation is

10=4s+3t

3. Rewrite the objective function in terms of a single variable.

Rewriting in terms of t keeps the algebra a bit simpler.

Rearrange the constraint equation:

4s=10−3t

s=410−3t​

=25​−43t​

Substitute into the area function:

A(t)=(25​−43t​)2+43​​t2

4. Find the extrema of the objective function

Differentiate:

A′(t)=2⋅(25​−43t​)1⋅(−43​)+43​​(2t)

=−46​(25​−43t​)+2t3​​

=−23​(25​−43t​)+2t3​​

=−415​+89t​+2t3​​

Solve A′(t)=0:

−415​+89t​+2t3​​=0

89t​+2t3​​=415​

Multiply both sides by 8:

9t+4t3​=30

t(9+43​)=30

t=9+43​30​

≈1.88345

Use the 2nd derivative test. From above,

A′(t)=−415​+89t​+2t3​​

Differentiate:

A′′(t)=89​+23​​

Since A′′(t)>0, A(t) is concave up, so the critical number t≈1.88345 gives a minimum total area.

To find the maximum, test the endpoints of the interval (the smallest and largest possible values of t).

The side length t can’t be negative, but it can be 0 (meaning all wire goes to the square).

If t=0, then

A(0)=(25​−43(0)​)2+43​​(0)2

=12.5 m2

If all the wire is used for the triangle, then s=0 and each side is 310​. The area is

A=43​​(310​)2

≈4.811 m2

Evaluate the area at the critical value to confirm it’s the minimum:

A(1.88345)=(25​−43(1.88345)​)2+43​​(1.88345)2

≈2.719 m2

Comparing these values:

  • The maximum total area occurs at t=0, so all the wire should be used to make the square.
  • The minimum total area occurs at t≈1.88345.

To describe the cut for the minimum-area case, convert t to the triangle’s perimeter:

3(1.88345)=5.650

So cut the wire into two pieces:

  • 5.65 meters to form the triangle
  • 10−5.65=4.35 meters to form the square

Recognizing optimization problems

  • Look for keywords: maximum, minimum, largest, greatest, smallest, least
  • Focus is on maximizing or minimizing a quantity under constraints
  • Not the same as related rates (which involve rates of change over time)

General optimization strategy

  • Identify the objective function (what to optimize)
  • Write constraint equation(s) from problem conditions
  • Express objective function in terms of a single variable using the constraint
  • Find extrema:
    • Take derivative, set to zero to find critical points
    • Use first or second derivative test to determine min/max

Example: Rectangle with fixed area

  • Objective: minimize perimeter P=2L+2W
  • Constraint: area A=LW=16
  • Substitute: W=L16​, so P(L)=2L+L32​
  • Find minimum: solve P′(L)=0⟹L=4
  • Minimum perimeter: P(4)=16 m

Optimization vs. related rates

  • Optimization: maximize/minimize a function, not find a rate
  • Related rates: involve derivatives with respect to time

Example: Boats minimizing distance

  • Place boats on coordinate plane, write positions as functions of time
  • Distance function: D(t)=(10−3t)2+16t2​
  • Minimize D(t) (or D(t)2 for easier calculus)
  • Find minimum: t=1.2 hours, minimum distance =8 km

Example: Allocating wire to maximize/minimize area

  • Objective: maximize/minimize total area of square and triangle
  • Variables: s (square side), t (triangle side)
  • Constraint: 4s+3t=10
  • Area function: A=s2+43​​t2
  • Substitute to get A in terms of t only
  • Find critical point for minimum area: t≈1.88 m
  • Test endpoints for maximum area:
    • All wire to square (t=0): maximum area
    • All wire to triangle (s=0): compare area values
  • Minimum area: split wire into 5.65 m (triangle), 4.35 m (square)
  • Maximum area: use all wire for square

Sign up for free to take 5 quiz questions on this topic

All rights reserved ©2016 - 2026 Achievable, Inc.

Optimization

What you’ll learn:

  • How to recognize optimization problems by key words
  • Solve optimization problems in real-world contexts, including geometry and motion
  • Distinguishing optimization and related rates problems

Optimization means finding the maximum or minimum value of a quantity while meeting certain constraints. It’s a common real-world application of derivative tests. You can usually spot an optimization problem by key words like maximum/minimum or largest/greatest/smallest/least.

General strategy

The following example will be a reference for the step-by-step process:

  1. What is the minimum perimeter of a rectangle that has an area of 16 m2?

1. Identify the objective function to optimize (what you’re trying to maximize or minimize).

The goal is to minimize the perimeter of the rectangle. Let the dimensions be L (length) and W (width). The objective function is

P=2L+2W

2. Determine the constraint equation(s).

The rectangle is constrained by its area, which must be 16 m2. So the constraint equation is

A=L×W

16=L×W

3. Rewrite the objective function in terms of a single variable.

Do this by using the constraint to substitute for one variable in the objective function. It usually doesn’t matter which variable you choose. (If the question asked for the length that minimizes the perimeter, rewriting everything in terms of L would save a step.)

Rearrange the constraint equation:

W=L16​

Now substitute into the perimeter formula:

P(L)=2L+2W

=2L+L32​

4. Find the extrema of the objective function

To find where the perimeter is minimized, find the critical point(s) of P(L) (values of L where P′(L)=0 or where P′(L) is undefined). Differentiate:

P′(L)=2−L232​

Solve P′(L)=0:

2−L232​=0

2=L232​

L2=16

L=±4

Because L represents a length, we restrict to L>0. So the only meaningful critical point is L=4.

Now decide whether L=4 gives a maximum or a minimum. You can use either the 1st derivative test or the 2nd derivative test.

1st derivative test:

Test intervals around L=4. The domain is L>0.

Interval Sign of P′(L) P(L) behavior
(0,4) − ↘
(4,∞) + ↗

Because P′(L) changes from negative to positive, P(L) has a local minimum at L=4.

2nd derivative test:

Start with

P′(L)=2−L232​

Differentiate again:

P′′(L)=L364​

For L>0, we have P′′(L)>0, so P(L) is concave up on its domain. That means the critical point L=4 gives a local minimum, matching the 1st derivative test.

The question asks for the minimum perimeter, so evaluate P at L=4:

P(4)=2(4)+432​

=16 m​

Sidenote
Not related rates

Optimization problems involve maximizing or minimizing quantities, while related rates problems involve quantities that change with respect to time (often requiring implicit differentiation). Be sure not to confuse the two.

Even though optimization problems aren’t related rates problems, time can still be the input variable. The next problem changes over time, but it’s still optimization because the goal is to minimize a function, not to find a rate.

  1. Boat Achievable is due west of Boat Calculus a distance of 10 km away. Boat Achievable starts heading east at 3 km/hr at the same time that Boat Calculus heads north at 4 km/hr. At what time are the two boats closest together? What is the distance between them at this time?

Solution

(spoiler)

1. Identify the objective function to optimize

The goal is to find when the distance between the two boats is as small as possible.

Place the boats on a coordinate plane. Let Boat Calculus start at (0,0) and Boat Achievable start at (−10,0).

Since distance = rate × time, the position of Boat Calculus at time t is

(0,4t)

and the position of Boat Achievable at time t is

(−10+3t,0)

Use the distance formula (from the Pythagorean theorem). The distance between the boats is

D(t)=(0−(−10+3t))2+(4t−0)2​

=(10−3t)2+16t2​

=100−60t+25t2​

Minimizing D(t) is equivalent to minimizing D(t)2, and the squared version avoids the square root. So we’ll minimize

f(t)=100−60t+25t2,t≥0.

2. Determine the constraint equation(s).

Unlike the rectangle problem, there’s no fixed constraint equation here. The motion of each boat is already built into the position formulas.

3. Rewrite the objective function in terms of a single variable.

The objective function is already in terms of one variable, t.

4. Find the extrema of the objective function

Differentiate f(t):

f′(t)=−60+50t

Solve f′(t)=0:

−60+50t=0

50t=60

t=56​=1.2

Use the 2nd derivative test:

f′′(t)=50

Since f′′(t)>0, f(t) is concave up and has a relative minimum at t=1.2. Because f(t)=D(t)2, minimizing f(t) also minimizes D(t).

So the boats are closest after

1.2 hours​.

Now find the minimum distance:

D(1.2)=100−60(1.2)+25(1.2)2​

=8 km​

For some optimization problems, you also have to consider additional limitations. In those cases, you’ll test endpoints of an interval using the extreme value theorem.

  1. You have a piece of wire 10 meters long and need to form a circle and/or a square. You can use the entire wire for a single shape or cut it and bend each piece into one of each shape. How should the wire be allocated to:
    a) Maximize the total enclosed area?
    b) Minimize the total enclosed area?

Solution

(spoiler)

1. Identify the objective function to optimize

The goal is to optimize the total enclosed area.

Define variables: let the side length of the square bes, and let each side of the equilateral triangle be t.

The area of the square is s2.

The area of the equilateral triangle is 43​​t2.

So the total area is

A=s2+43​​t2

2. Determine the constraint equation(s).

The 10-meter wire becomes the sum of the perimeters.

The perimeter of the square is 4s.

The perimeter of the equilateral triangle is 3t.

So the constraint equation is

10=4s+3t

3. Rewrite the objective function in terms of a single variable.

Rewriting in terms of t keeps the algebra a bit simpler.

Rearrange the constraint equation:

4s=10−3t

s=410−3t​

=25​−43t​

Substitute into the area function:

A(t)=(25​−43t​)2+43​​t2

4. Find the extrema of the objective function

Differentiate:

A′(t)=2⋅(25​−43t​)1⋅(−43​)+43​​(2t)

=−46​(25​−43t​)+2t3​​

=−23​(25​−43t​)+2t3​​

=−415​+89t​+2t3​​

Solve A′(t)=0:

−415​+89t​+2t3​​=0

89t​+2t3​​=415​

Multiply both sides by 8:

9t+4t3​=30

t(9+43​)=30

t=9+43​30​

≈1.88345

Use the 2nd derivative test. From above,

A′(t)=−415​+89t​+2t3​​

Differentiate:

A′′(t)=89​+23​​

Since A′′(t)>0, A(t) is concave up, so the critical number t≈1.88345 gives a minimum total area.

To find the maximum, test the endpoints of the interval (the smallest and largest possible values of t).

The side length t can’t be negative, but it can be 0 (meaning all wire goes to the square).

If t=0, then

A(0)=(25​−43(0)​)2+43​​(0)2

=12.5 m2

If all the wire is used for the triangle, then s=0 and each side is 310​. The area is

A=43​​(310​)2

≈4.811 m2

Evaluate the area at the critical value to confirm it’s the minimum:

A(1.88345)=(25​−43(1.88345)​)2+43​​(1.88345)2

≈2.719 m2

Comparing these values:

  • The maximum total area occurs at t=0, so all the wire should be used to make the square.
  • The minimum total area occurs at t≈1.88345.

To describe the cut for the minimum-area case, convert t to the triangle’s perimeter:

3(1.88345)=5.650

So cut the wire into two pieces:

  • 5.65 meters to form the triangle
  • 10−5.65=4.35 meters to form the square
Key points

Recognizing optimization problems

  • Look for keywords: maximum, minimum, largest, greatest, smallest, least
  • Focus is on maximizing or minimizing a quantity under constraints
  • Not the same as related rates (which involve rates of change over time)

General optimization strategy

  • Identify the objective function (what to optimize)
  • Write constraint equation(s) from problem conditions
  • Express objective function in terms of a single variable using the constraint
  • Find extrema:
    • Take derivative, set to zero to find critical points
    • Use first or second derivative test to determine min/max

Example: Rectangle with fixed area

  • Objective: minimize perimeter P=2L+2W
  • Constraint: area A=LW=16
  • Substitute: W=L16​, so P(L)=2L+L32​
  • Find minimum: solve P′(L)=0⟹L=4
  • Minimum perimeter: P(4)=16 m

Optimization vs. related rates

  • Optimization: maximize/minimize a function, not find a rate
  • Related rates: involve derivatives with respect to time

Example: Boats minimizing distance

  • Place boats on coordinate plane, write positions as functions of time
  • Distance function: D(t)=(10−3t)2+16t2​
  • Minimize D(t) (or D(t)2 for easier calculus)
  • Find minimum: t=1.2 hours, minimum distance =8 km

Example: Allocating wire to maximize/minimize area

  • Objective: maximize/minimize total area of square and triangle
  • Variables: s (square side), t (triangle side)
  • Constraint: 4s+3t=10
  • Area function: A=s2+43​​t2
  • Substitute to get A in terms of t only
  • Find critical point for minimum area: t≈1.88 m
  • Test endpoints for maximum area:
    • All wire to square (t=0): maximum area
    • All wire to triangle (s=0): compare area values
  • Minimum area: split wire into 5.65 m (triangle), 4.35 m (square)
  • Maximum area: use all wire for square