Optimization - Michael Cavers

Optimization
Optimization problems generally have the following goal:
Goal
Find the largest or smallest value of a function (called the objective function) subject to a
restriction (called the constraint).
Here is a general strategy to follow.
Optimization Guidelines
Understand the problem by reading it carefully. Make sure you know what is being
maximized/minimized and what the constraint is.
Draw a picture and label it.
Introduce notation, such as A for area, r for radius, etc.
Put this notation on your picture.
Find a formula for what is being minimized/maximized and a formula for the constraint.
Using the constraint, eliminate one of the variables in the formula for the quantity being
minimized/maximized.
Determine a suitable interval (bounds on your variables).
Determine the absolute minimum/maximum of the function by finding and classifying
critical points (and endpoints if applicable)
Calculus (University of Calgary)
Fall 2013
1 / 14
Methods to classify absolute max/min
Fact: The maximum and minimum values of a continuous function on a closed interval will
occur at the critical points and/or end points.
Method 1: Test for Absolute Extrema of Continuous Functions on Closed Intervals
1
Verify that the function is continuous on the interval [a, b].
2
Find all critical points of f (x ) that are in the interval [a, b].
3
Evaluate the function at the critical points found in step 2 and the end points.
4
Identify the absolute extrema by comparing values.
Calculus (University of Calgary)
Fall 2013
2 / 14
Example
We would like to create a rectangular fenced off area for our dog to play in. We will use 600 feet
of fencing material. A building will be on one side of the playpen (so won’t need any fencing).
Determine the dimensions of the playpen that will enclose the largest area.
Let x and y be the dimensions of the playpen.
Calculus (University of Calgary)
Fall 2013
3 / 14
In optimization problems, we will (usually) have two functions.
The first is the function we wish to optimize and the second is the constraint.
Objective: To maximize the area of the playpen.
Given: We will use 600 feet of fencing material.
The objective is to maximize area and the constraint is the amount of fencing available
(perimeter).
Maximize : A = xy
Constraint : x + 2y = 600
Eliminate one of the variables in the area function by using the constraint function.
600 − x
x
→
y =
y = 300 −
We have: 2y = 600 − x
→
2
2
Substituting this into the area function gives:
x
1
= 300x − x 2
2
2
We could also have solved for x and obtained a function A(y ).
A(x ) = x
Calculus (University of Calgary)
300 −
Fall 2013
4 / 14
A(x ) = 300x −
1 2
x
2
Bounds: how large/small can x be?
I
I
Smallest: Need x ≥ 0 as x is a length.
Largest: Need x ≤ 600 otherwise the constraint gives y < 0.
This comes from setting y = 0 in the constraint equation.
Goal: Find the absolute maximum of A(x ) on the interval [0, 600].
We use the Test for Absolute Extrema
1
2
3
4
A(x ) is a continuous function (polynomial) on a closed interval.
To find critical points, we need the derivative: A0 (x ) = 300 − x
F Setting A0 (x ) = 0 gives only one critical point of x = 300 in our interval.
Evaluate A(x ) at the critical points and endpoints:
F Endpoints: A(0) = 0 and A(600) = 0
F Critical Points: A(300) = 45, 000
Comparing gives the absolute maximum of 45, 000 at x = 300.
Plugging x = 300 into the constraint gives y = 150.
Therefore, the dimensions of the playpen that give the largest area, subject to the fact that
we used 600 ft of fencing material, is 300 ft × 150 ft.
Calculus (University of Calgary)
Fall 2013
5 / 14
Methods to classify absolute max/min
Method 1: Use the Test for Absolute Extrema as in the previous problem.
Method 2: Use the First Derivative Test and observation below.
Method 3: Use the Second Derivative Test and observation below.
Observation:
Let I be the interval of all possible optimal values of f (x ).
Suppose that f (x ) is continuous on I, except possibly at the endpoints.
Finally, suppose that x = c is the ONLY critical point of f (x ) in I.
I
I
If x = c is a local max, then it is the absolute max on I.
If x = c is a local min, then it is the absolute min on I.
Calculus (University of Calgary)
Fall 2013
6 / 14
First and Second Derivative Tests
Recall the test for increasing/decreasing:
I
I
f 0 (x ) > 0 for x ∈ I implies f increasing on I.
f 0 (x ) < 0 for x ∈ I implies f decreasing on I.
First Derivative Test: Suppose x = c is a critical point of f (x ):
I
I
If f is increasing immediately to the left of x = c and decreasing immediately to the
right of x = c, then x = c is a local max.
If f is decreasing immediately to the left of x = c and increasing immediately to the
right of x = c, then x = c is a local min.
Recall the test for concavity:
I
I
f 00 (x ) > 0 for x ∈ I implies f concave up on I.
f 00 (x ) < 0 for x ∈ I implies f concave down on I.
Second Derivative Test: If x = c is a critical point with f 0 (c) = 0 and f 00 (x ) is continuous
in a region around x = c:
I
I
If f 00 (c) < 0, then x = c is a local max.
If f 00 (c) > 0, then x = c is a local min.
Calculus (University of Calgary)
Fall 2013
7 / 14
Example
A manufacturer needs to make a cylindrical can that will hold 1500 cm3 (or equivalently, 1.5 L)
of liquid. Determine the dimensions of the can that will minimize the amount of material used in
its construction.
Let h be the height of the can and r the radius of the top.
Calculus (University of Calgary)
Fall 2013
8 / 14
Example
A manufacturer needs to make a cylindrical can that will hold 1500 cm3 (or equivalently, 1.5 L)
of liquid. Determine the dimensions of the can that will minimize the amount of material used in
its construction.
Objective: To minimize the amount of material used.
Given: The constraint is the volume.
For the amount of material used we need the surface area (SA) of the can.
Surface Area = area of top + area of bottom + area of side
SA = πr 2 + πr 2 + 2πrh = 2πr 2 + 2πrh
Calculus (University of Calgary)
Fall 2013
9 / 14
Example
A manufacturer needs to make a cylindrical can that will hold 1500 cm3 (or equivalently, 1.5 L)
of liquid. Determine the dimensions of the can that will minimize the amount of material used in
its construction.
Volume of a cylinder is V = πr 2 h.
Given that the volume of the can is 1500 we have:
Minimize :
Constraint :
SA = 2πr 2 + 2πrh
πr 2 h = 1500
We will eliminate h from the first equation by using the second equation:
1500
πr 2
Substituting gives the surface area as a function of r :
h=
SA(r ) = 2πr 2 + 2πr
1500
πr 2
= 2πr 2 +
3000
r
Bounds: how large/small can r be?
I
I
Smallest: Need r > 0 as r is a length (0 is not included since SA(r ) has r in the
denominator).
Largest: No upper bound seems to come from the constraint.
Goal: Find the absolute minimum of SA(r ) on the interval (0, ∞).
Calculus (University of Calgary)
Fall 2013
10 / 14
All three methods to find absolute extrema need the critical points
3000
We differentiate SA(r ) = 2πr 2 +
to find the critical points:
r
3000
4πr 3 − 3000
=
2
r
r2
p
0
3
≈ 6.2035
SA (r ) = 0 when the top is zero: 4πr − 3000 = 0 → r = 3 750
π
SA0 (r ) = 4πr −
I
As r =
SA0 (r )
I
p
3 750
π
is in the domain of SA(r ), it is a critical point.
is DNE when the bottom is zero: r 2 = 0
→
r =0
But, r = 0 is not in the domain of SA(r ), thus it is not a critical point.
Method 1 cannot be used since we don’t have a closed interval.
Methods 2 and 3 will both work since r = 6.2035 is the ONLY critical point.
For Method 2 we need to verify that SA0 (r ) < 0 for r < 6.2035 and SA0 (r ) > 0 for
r > 6.2035.
Instead we use Method 3.
We have SA00 (r ) = 4π + 6000r −3 , for which we know SA00 (r ) > 0 whenever r > 0.
Therefore, by the Second Derivative Test, r = 6.2035 is the absolute min.
When r = 6.2035 we have h =
1500
π(6.2035)2
= 12.4070.
The dimensions that minimize the amount of material to create a cylindrical can of volume
1.5 L are a height of 12.4 cm and radius of 6.2 cm.
Calculus (University of Calgary)
Fall 2013
11 / 14
Example
We want to build a window with the bottom is a rectangle and the top is a semicircle. If there is
12 m of framing material, what must the dimensions of the window be to let in the most light?
Let r be the radius of the semicircle top and h the height of the bottom rectangle.
Calculus (University of Calgary)
Fall 2013
12 / 14
Example
We want to build a window with the bottom is a rectangle and the top is a semicircle. If there is
12 m of framing material, what must the dimensions of the window be to let in the most light?
Objective: To maximize the amount of light (area).
Given: The constraint is the amount of framing material (perimeter).
Maximize :
Constraint :
A = 2rh + (1/2)πr 2
2h + 2r + πr = 12
We will eliminate h from the first equation by using the second equation:
2h = 12 − 2r − πr
Thus, A(r ) = 2r
6−r −
Calculus (University of Calgary)
1
πr
2
+
1
(πr 2 )
2
→
h =6−r −
→
1
πr
2
A(r ) = 12r − 2r 2 −
1 2
πr
2
Fall 2013
13 / 14
Bounds: how large/small can r be?
Smallest: Need r ≥ 0 as r is a length
Largest: If r is too large, the value of h becomes negative by the constraint
We can find the largest value of r by setting h = 0 in the constraint:
12
2r + πr = 12
→
(2 + π)r = 12
→
r =
≈ 2.3339
2+π
Goal: Find the absolute maximum of A(r ) on the interval [0, 2.3339].
I
I
All three methods to find absolute extrema need the critical points.
1
We differentiate A(r ) = 12r − 2r 2 − πr 2 to find the critical points:
2
A0 (r ) = 12 − 4r − πr
A0 (r ) = 0 when: 12 − 4r − πr = 0
I
→
A00 (r ) = −(4 + π)
r = 12/(4 + π) ≈ 1.6803
As r = 12/(4 + π) is in the domain of A(r ), it is a critical point.
We can use Method 3 since we only have one critical point.
Since A00 (r ) < 0 for all r ≥ 0, we know that the critical point r = 12/(4 + π) will be an
absolute maximum by the Second Derivative Test.
1
Then, h = 6 − (1.6803) − π(1.6803) ≈ 1.6803.
2
To let in the most light, the rectangle must have dimensions 3.3606 m by 1.6803 m and
the semicircle must have a radius of 1.6803 m.
Calculus (University of Calgary)
Fall 2013
14 / 14