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
10. test
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

10 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, or finding the maximum or minimum value of a quantity given certain constraints, is a real-world application of the derivative tests. To figure out if you’re dealing with an optimization problem, look for the key words “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. We’ll label the dimensions as L (length) and W (width). The objective function is

P=2L+2W

2. Determine the constraint equation(s).

The rectangle is constrained by the area, which must be 20 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 substituting the constraint into the objective function. It usually doesn’t matter which variable you rewrite it in. But if the question asked for “what length will minimize the perimeter?” it’d be better to rewrite P in terms of L to save a step later on. Rearranging the constraint equation,

W=L16​

Then

P(L)=2L+2W

=2L+L32​

4. Find the extrema of the objective function

Since we’re trying to find where the perimeter is a minimum, this requires finding the critical point - the value of L where the function P might be an extrema. Differentiating,

P′(L)=2−L232​

Solving P′(L)=0,

2−L232​=0

2=L232​

L2=16

L=±4

Most optimization problems will involve real-world contexts (physical dimensions with length, area, volume, time, etc.). So negative values are meaningless and should be excluded from the domain. L=4 is the only critical point.

We can use the either the 1st or the 2nd derivative test to determine if L=4 results in a max or a min.

1st derivative test:

Test points around L=4. The only limitation is that L>0.

If L is extremely large, W will just be extremely small but the constraint can still be satisfied. It’ll just be an absurdly narrow rectangle.

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

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

2nd derivative test:

P′(L)=2−L232​

P′′(L)=L364​

Because L is always positive, P′′(L) is also always positive. So P(L) is always concave up and there is a local minimum at the critical number L=4, which confirms the result from the 1st derivative test.

The conclusion is that a length of 4 meters will result in the minimum perimeter. The question asked for the minimum perimeter so the answer is

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

Sidenote
Not related rates

Optimization problems involve maximizing or minimizing quantities while related rates involve quantities that affect each other over time (requiring implicit differentiation). Be sure not to confuse the two.

Although optimization problems are not related rates problems, sometimes time can still be the input variable. The next problem involves a situation that changes over time but is an optimization problem because the objective is to optimize a function rather than find a rate.

2. 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 at what time the distance between the two boats is at a minimum. So we’re trying to minimize the distance function.

Picture the boats on a coordinate plane. Boat Calculus starts at (0,0) while Boat Achievable starts at (−10,0).

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

(0,4t)

while the position of Boat Achievable is

(−10+3t,0)

The distance between the two boats involves a right triangle, or the Pythagorean theorem/distance formula. The objective function is:

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

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

100−60t+25t2​

Minimizing (D(t))2 is the same as minimizing D(t). If we use the parabola 25t2−60t+100 as the objective function instead (with t≥0), differentiating and finding critical points later will be easier.

2. Determine the constraint equation(s).

Unlike the previous problem with a rectangle of fixed area, there is no constraint or limitation. We’re simply tracking how the boats move to find when they’re closest.

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

The objective function is already written in terms of one variable only - another reason why no constraint is needed.

4. Find the extrema of the objective function

To minimize the function f(t)=100−60t+25t2 (the square of the distance function), differentiate.

f′(t)=−60+50t

Solving f′(t)=0,

−60+50t=0

50t=60

t=56​=1.2

Let’s use the 2nd derivative test.

f′′(t)=50

Since f′′(t) is always positive, f(t) is concave up and there is a relative minimum at the critical number t=1.2. f(t), the square of the distance function, is minimized, so the actual distance is also minimized The time at which the two boats are closest together is after 1.2 hours​. The minimum distance, plugging it into the distance function, is

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

=8 km​

For some optimization problems, you’ll also have to consider additional limitations. This will involve testing the endpoints of an interval with the extreme value theorem.

3. 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 area. First, let’s define variables. Let the side length of the square be s and each side of the triangle be t

The area of the square is s2.

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

The function to optimize is the total area enclosed by the shapes:

A=s2+43​​t2

2. Determine the constraint equation(s).

The 10 meter long wire becomes the sum of the perimeter of the shapes.

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.

It appears that rewriting the area function in terms of t will be easier (to avoid dealing with the square root too much).

Rearranging the constraint equation,

4s=10−3t

s=410−3t​

=25​−43t​

Then the objective function rewritten is:

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

4. Find the extrema of the objective function

Differentiating,

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

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

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

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

Solving for A′(t)=0,

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

89t​+2t3​​=415​

Multiplying both sides by the LCD of 8 to eliminate the fractions,

9t+4t3​=30

t(9+43​)=30

t=9+43​30​

≈1.88345

Either the 1st derivative or the 2nd derivative test can be used. Let’s go with the 2nd derivative test. From above,

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

Differentiating,

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

The 2nd derivative is always positive and A(t) is concave up, which means that the critical number we found for the side length of the triangle minimizes the total area.

In order to find the maximum, we have to test the endpoints of the interval, or what the smallest and largest values of t can be. The side length of the triangle, t, can’t be negative, but it can equal 0 - it just means that all of the wire will be allocated to making the square.

If t=0, then the area is

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

=12.5 m2

On the other hand, if all of the wire is used to make the triangle, then s=0 and each side of the triangle will have length 310​. The area of this equilateral triangle is

A=43​​(310​)2

≈4.811 m2

Though it’s already known that the critical number t=1.88345 that we found produces the minimum area, we can confirm this:

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

≈2.719 m2

Comparing the three values found for the area shows that to maximize the total enclosed area, t=0, which means all of the wire must go toward making the square.

To minimize the total enclosed area, t=1.88345. But that’s just the side length of the triangle. The portion of the wire to be cut was its perimeter:

3(1.88345)=5.650

So the wire should be cut into two pieces where the piece of length 5.65 meters is bent into a triangle and the other piece of 10−5.65=4.35 meters is bent into a square.

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

All rights reserved ©2016 - 2026 Achievable, Inc.