SYDE 112, LECTURE 34 & 35: Optimization on Restricted Domains and Lagrange Multipliers

Similar documents
Practice problems from old exams for math 233

MATH 105: Midterm #1 Practice Problems

ANSWER KEY. (a) For each of the following partials derivatives, use the contour plot to decide whether they are positive, negative, or zero.

Name: ID: Section: Math 233 Exam 2. Page 1. This exam has 17 questions:

LECTURE 19 - LAGRANGE MULTIPLIERS

Lecture 15. Global extrema and Lagrange multipliers. Dan Nichols MATH 233, Spring 2018 University of Massachusetts

Exam 2 Review Sheet. r(t) = x(t), y(t), z(t)

CHAPTER 11 PARTIAL DERIVATIVES

Similarly, the point marked in red below is a local minimum for the function, since there are no points nearby that are lower than it:

MATH Exam 2 Solutions November 16, 2015

Exam 2 Summary. 1. The domain of a function is the set of all possible inputes of the function and the range is the set of all outputs.

Math 259 Winter Recitation Handout 9: Lagrange Multipliers

2.1 Partial Derivatives

Math 148 Exam III Practice Problems

4 to find the dimensions of the rectangle that have the maximum area. 2y A =?? f(x, y) = (2x)(2y) = 4xy

Math 32, October 22 & 27: Maxima & Minima

Goals: To study constrained optimization; that is, the maximizing or minimizing of a function subject to a constraint (or side condition).


Definitions and claims functions of several variables

Review guide for midterm 2 in Math 233 March 30, 2009

Review Problems. Calculus IIIA: page 1 of??

MATH 12 CLASS 9 NOTES, OCT Contents 1. Tangent planes 1 2. Definition of differentiability 3 3. Differentials 4

Solutions to the problems from Written assignment 2 Math 222 Winter 2015

FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

MATH Review Exam II 03/06/11

University of California, Berkeley Department of Mathematics 5 th November, 2012, 12:10-12:55 pm MATH 53 - Test #2

Maxima and Minima. Chapter Local and Global extrema. 5.2 Continuous functions on closed and bounded sets Definition of global extrema

MATH 259 FINAL EXAM. Friday, May 8, Alexandra Oleksii Reshma Stephen William Klimova Mostovyi Ramadurai Russel Boney A C D G H B F E

MATH 8 FALL 2010 CLASS 27, 11/19/ Directional derivatives Recall that the definitions of partial derivatives of f(x, y) involved limits

Review Sheet for Math 230, Midterm exam 2. Fall 2006

11.7 Maximum and Minimum Values

Differentiable functions (Sec. 14.4)

Lecture 4 : Monday April 6th

WESI 205 Workbook. 1 Review. 2 Graphing in 3D

Now we are going to introduce a new horizontal axis that we will call y, so that we have a 3-dimensional coordinate system (x, y, z).

Test Yourself. 11. The angle in degrees between u and w. 12. A vector parallel to v, but of length 2.

Maxima and Minima. Terminology note: Do not confuse the maximum f(a, b) (a number) with the point (a, b) where the maximum occurs.

MULTI-VARIABLE OPTIMIZATION NOTES. 1. Identifying Critical Points

MATH 261 EXAM II PRACTICE PROBLEMS

Examples: Find the domain and range of the function f(x, y) = 1 x y 2.

SOLUTIONS 2. PRACTICE EXAM 2. HOURLY. Problem 1) TF questions (20 points) Circle the correct letter. No justifications are needed.

Functions of several variables

Math 2411 Calc III Practice Exam 2

Math 5BI: Problem Set 1 Linearizing functions of several variables

Instructions: Good luck! Math 21a Second Midterm Exam Spring, 2009

Practice Problems: Calculus in Polar Coordinates

Math 233. Extrema of Functions of Two Variables Basics

Math 2321 Review for Test 2 Fall 11

11/18/2008 SECOND HOURLY FIRST PRACTICE Math 21a, Fall Name:

Math 232. Calculus III Limits and Continuity. Updated: January 13, 2016 Calculus III Section 14.2

13.2 Define General Angles and Use Radian Measure. standard position:

Chapter 6: Periodic Functions

Section 15.3 Partial Derivatives

Calculus 3 Exam 2 31 October 2017

Practice problems from old exams for math 233

MAT187H1F Lec0101 Burbulla

Unit 8 Trigonometry. Math III Mrs. Valentine

Lecture 19 - Partial Derivatives and Extrema of Functions of Two Variables

Multivariate Calculus

11.2 LIMITS AND CONTINUITY

Math for Economics 1 New York University FINAL EXAM, Fall 2013 VERSION A

MATH 234 THIRD SEMESTER CALCULUS

[f(t)] 2 + [g(t)] 2 + [h(t)] 2 dt. [f(u)] 2 + [g(u)] 2 + [h(u)] 2 du. The Fundamental Theorem of Calculus implies that s(t) is differentiable and

11/2/2016 Second Hourly Practice I Math 21a, Fall Name:

MATH 253 Page 1 of 7 Student-No.: Midterm 2 November 16, 2016 Duration: 50 minutes This test has 4 questions on 7 pages, for a total of 40 points.

Functions of more than one variable

14.4. Tangent Planes. Tangent Planes. Tangent Planes. Tangent Planes. Partial Derivatives. Tangent Planes and Linear Approximations

11/1/2017 Second Hourly Practice 2 Math 21a, Fall Name:

Mock final exam Math fall 2007

10.1 Curves defined by parametric equations

1 Graphs of Sine and Cosine

Calculus II Fall 2014

7/26/2018 SECOND HOURLY PRACTICE I Maths 21a, O.Knill, Summer Name:

Partial Differentiation 1 Introduction

266&deployment= &UserPass=b3733cde68af274d036da170749a68f6

This exam contains 9 problems. CHECK THAT YOU HAVE A COMPLETE EXAM.

The Chain Rule, Higher Partial Derivatives & Opti- mization

MAT01B1: Calculus with Polar coordinates

Solutions to Exercises, Section 5.6

Math 122: Final Exam Review Sheet

REVIEW SHEET FOR MIDTERM 2: ADVANCED

Math Final Exam - 6/11/2015

33. Riemann Summation over Rectangular Regions

Unit 7 Partial Derivatives and Optimization

Chapter 3, Part 1: Intro to the Trigonometric Functions

(d) If a particle moves at a constant speed, then its velocity and acceleration are perpendicular.

14.7 Maximum and Minimum Values

Trig functions are examples of periodic functions because they repeat. All periodic functions have certain common characteristics.

VECTOR CALCULUS Julian.O 2016

5/4/2005 Antenna Pattern present 1/1. C. Antenna Pattern

Section 3: Functions of several variables.

PREREQUISITE/PRE-CALCULUS REVIEW

Directional Derivative, Gradient and Level Set

Lecture 19. Vector fields. Dan Nichols MATH 233, Spring 2018 University of Massachusetts. April 10, 2018.

Section 14.3 Partial Derivatives

47. Conservative Vector Fields

13.4 Chapter 13: Trigonometric Ratios and Functions. Section 13.4

Trigonometric Identities. Copyright 2017, 2013, 2009 Pearson Education, Inc.

Sect 4.5 Inequalities Involving Quadratic Function

B) 0 C) 1 D) No limit. x2 + y2 4) A) 2 B) 0 C) 1 D) No limit. A) 1 B) 2 C) 0 D) No limit. 8xy 6) A) 1 B) 0 C) π D) -1

Transcription:

SYDE 112, LECTURE 34 & 35: Optimization on Restricted Domains and Lagrange Multipliers 1 Restricted Domains If we are asked to determine the maximal and minimal values of an arbitrary multivariable function f(x, y), we know the following things so far: 1. that they may be obtained at only critical points, singular points, or boundary points of the domain; and 2. the nature of critical points can be determined (most of the time) by the second derivative test. We are very close to being able to answer an arbitrary optimization question. The only glaring omission in our discussion so far is what happens when we want the optimal value of a function f(x, y) of a restricted domain? In other words, what happens when we have to consider not only critical points, but also the boundary of a region? The answer is perhaps best handled by consider a few examples. Example 1: Find the maximal and minimal values of f(x, y) = x 2 y 2 restricted to the interior of the unit circle R = { (x, y) R 2 x 2 + y 2 1 } (see Figure 1). Solution: Since there are no singular points, we know that the maximal and minimal values can only occur at critical values in the interior or the region R and the boundary of the R. To find the critical points, we solve f(x, y) = (0, 0) which gives f x (x, y) = 2x = 0 = x = 0 f y (x, y) = 2y = 0 = y = 0. 1

Figure 1: The function f(x, y) = x 2 y 2 restricted to the interior of the unit circle, i.e. x 2 + y 2 1. Since (0, 0) is in the interior of R, it is a potential extreme value. We can see, however, that A = f xx (x, y) = 2 B = f xy (x, y) = 0 C = f yy (x, y) = 2 which gives B 2 AC = (0) 2 (2)( 2) > 4. It follows that (0, 0) is a saddle point and therefore cannot be a maximal or minimal value of f(x, y) in R. It remains to check the boundary of R, which is the unit circle { (x, y) R 2 x 2 + y 2 = 1 }. There are several methods at this point which we could follow to find the maximal and minimal values on the boundary. In all cases, however, the general goal is the same: We want to use the constraint to reduce the number of variables, and then solve the remaining problem as lower-dimensional optimization problem. In this case, since we have two variables to begin with, we want to use the constraint x 2 + y 2 = 1 to reduce the problem to a one-dimensional optimization problem. We will go through two methods by which we can do this for this problem (each question of this type is slightly different so it important to develop an intuition of different methods of parametrization). First, consider rearranging the constraint x 2 + y 2 = 1 into y 2 = 1 x 2. Since we are only interested in values of the function f(x, y) satisfying this 2

express, we can rewrite f(x, y) entirely in terms of x as f(x) = x 2 (1 x 2 ) = 2x 2 1. We notice that the constraint y 2 = 1 x 2 was only valid for 1 x 1 so that we have reduced the original two-dimensional optimization problem to the one-dimensional optimization problem of finding the maximal and minimal values of f(x) = 2x 2 1 on the domain 1 x 1! To find the critical values, we find points satisfying f (x) = 0, which are given by f (x) = 4x = 0 = x = 0. We also need to consider the endpoints, which are x = 1 and x = 1. We have f( 1) = 1 f(0) = 1 f(1) = 1 We have that the function obtains a maximum value of 1 and a minimal value of 1 on the boundary of R. By the relation y = ± 1 x 2, we have that the minimal values occur at (0, ±1) and the maximal values occur at (±1, 0). We could also solve this question by rewriting the unit circle in polar coordinates. The expression x 2 + y 2 = 1 can be parametrized by the single variable θ [0, 2π) according to the parametrization (x, y) = (cos(θ), sin(θ)). The original expression f(x, y) can then be written entirely in terms of θ as f(θ) = cos 2 (θ) sin 2 (θ). To find the critical points of this expression, we differentiate to get f (θ) = 2 cos(θ) sin(θ) 2 sin(θ) cos(θ) = 4 sin(θ) cos(θ) = 0. This can be satisfied if either sin(θ) = 0 or cos(θ) = 0 so that the required points are θ = 0, π 2, π, 3π 2. 3

We can see that f(0) = cos 2 (0) sin 2 (0) = (1) 2 (0) 2 = 1 ( π ) ( f = cos 2 π ) ( sin 2 π ) = (0) 2 (1) 2 = 1 2 2 2 f(π) = cos 2 (π) sin 2 (π) = ( 1) 2 (0) 2 = 1 ( ) ( ) ( ) 3π 3π 3π f = cos 2 sin 2 = (0) 2 ( 1) 2 = 1. 2 2 2 It follows that the maximal value of f(x, y) on the unit circle is 1 and the minimal value is 1 and that the minimal values are attained at θ = π/2 and θ = 3π/2, and that the maximal values are attained at θ = 0 and θ = π. By the relationship x = cos(θ) and y = sin(θ), we have that the minimal values are attained at (0, ±1) and the maximal values are attained at (±1, 0), as before. Example 1: Find the maximal and minimal values of f(x, y) = x 2 y 2 restricted to the interior of the unit box R = { (x, y) R 2 1 x 1, 1 y 1 }. Figure 2: The function f(x, y) = x 2 y 2 restricted to the interior of the unit box, i.e. 1 x 1, 1 y 1. Solution: This is always exactly the same question as the previous example except that the domain has changed (see Figure 2). Since (0, 0) lies in the interior of this region, and it was the only critical point of the 4

function, we may disregard all interior points as potential maximal and minimal values. This leaves the boundary. In this case we have to parametrize the boundary as four separate lines. That is to say, we have to consider the top of the box, the two sides, and the bottom separately. Fortunately, doing each side individual is very simple! We notice that on the top of the box, we have y = 1 and 1 x 1. This means that the function f(x, y) can be reduced to f(x) = x 2 (1) 2 = x 2 1 where we are interested in optimizing this over 1 x 1! We need to check critical points and endpoints. We have f (x) = 2x = 0 = x = 0 so that the only critical point in 1 x 1 is at x = 0. We check all three relevant points to get f( 1) = 0 f(0) = 1 f(1) = 0. It follows that the minimal value attained on the top of the box is 1 and the maximal value is 0. The minimal value is attained at (x, y) = (0, 1) while the maximal value is attained at (±1, 1). If we check along the three remaining sides (left side: x = 1, 1 y 1; bottom: 1 x 1, y = 1; right side: x = 1, 1 x 1) we find that the maximal values is 1 and is attained at (±1, 0) and the minimal value is 1 and is attained at (0, ±1). 2 Lagrange Multipliers There is another way to approach a problem of the form: subject to the constraint Maximize/minimize f(x, y) g(x,y) = 0. Reconsider the question of finding the maximal and minimal values of f(x, y) = x 2 y 2 on the boundary of the unit circle, i.e. subject to the constraint g(x, y) = x 2 + y 2 1 = 0. 5

Now imagine overlaying the constraint curve g(x, y) onto the contour plot of f(x, y) (see Figure 3). Recall that the level curves correspond to curves where the height of the function f(x, y) does not change. If we imagine travelling from one level curve to another, therefore, we are changing our height. Now consider travelling along the curve given by the constraint set g(x, y) = 0. As we travel along this curve we cut across level sets, changing our height in the process. Suppose we are descending as we cross these level curves. It should not take much convincing to realize (see Figure 3) that we can only reverse course and start ascending (i.e. we reach a minimum and pass it) at one of two types of points: 1. critical points of f(x, y); and 2. points where g(x, y) meets the lower most level curve of f(x, y) tangentially. f(x,y) g(x,y)=0 Figure 3: As we travel around the circle corresponding to the constraint g(x, y) = x 2 + y 2 1 = 0, we only reach maximal and minimal values of f(x, y) where we meet the level curves of f(x, y) tangentially. The question then becomes how we turn this observation into a method for determining these minimal and maximal values. A method is not imme- 6

diately obvious, but consider the function L(x, y, λ) = f(x, y) + λg(x, y). This function is called a Lagrangian function and the new variable λ is called the Langrage multiplier. This function doesn t look like much at first glance, but it will be the key to unlocking this optimization puzzle. It turns out that the critical points of L(x, y, λ) exactly coincide with the potential maximal and minimal points outlined above! It is certainly not obvious that this should be the case, but we can check easily enough. Consider setting the first-order partial derivatives of L(x, y, λ) equal to zero (including the partial derivative with respect to λ!). We have (1) (2) (3) L(x, y, λ) = f(x, y) + λ g(x, y) = 0 x x x y L(x, y, λ) = y f(x, y) + λ g(x, y) = 0 y L(x, y, λ) = g(x, y) = 0. λ The third equation certainly looks good it just makes sure we are restricting ourselves to the constraint set but what about the first two? Recall that the gradient f(x, y) lies tangent to the level curves. Another way to characterize two curves meeting tangential at a point, therefore, is to have their gradients be scalar multiples of one another. This is exactly what equations (1) and (2) give us! Either we have 1. f(x, y) = (f x (x, y), f y (x, y)) = (0, 0) (in which case λ = 0 gives a solution); or 2. f(x, y) = λ g(x, y) (in which case the two gradients are scalar multiples of one another, which means the curves meet tangentially). At any rate, this gives rise to a new way of solve problems of the type subject to the constraint Maximize/minimize f(x, y) g(x,y) = 0. It is sufficient to find the critical points of L(x, y, λ) = f(x, y)+λg(x, y) and check f(x, y) at these values. 7

Example 1: Determine the maximal and minimal values of f(x, y) = x 2 y 2 subject to the constraint x 2 + y 2 = 1. Solution: We have L(x, y, λ) = f(x, y) + λg(x, y) = x 2 y 2 + λ(x 2 + y 2 1). It follows that the first order partial derivatives are given by L(x, y, λ) = 2x + 2λx x L(x, y, λ) = 2y + 2λy y λ L(x, y, λ) = x2 + y 2 1. Setting these equations equal to zero gives x(1 + λ) = 0 y( 1 + λ) = 0 x 2 + y 2 = 1. The first equation can be satisfied if either x = 0 or λ = 1. If x = 0, the third equation gives y = ±1, which gives λ = 1 in the second equation. If λ = 1 in the first equation, we need y = 0 in the second equation, which gives x = ±1 in the third equation. It follows that we have the following solutions (x, y, λ) = (0, ±1, 1) (x, y, λ) = (±1, 0, 1). The relevant (x, y) values we need to check are (x, y) = (1, 0), (x, y) = ( 1, 0), (x, y) = (0, 1), and (x, y) = (0, 1). We can easily see (as before) that f(1, 0) = 1 f( 1, 0) = 1 f(0, 1) = 1 f(0, 1) = 1. 8

so that the maximal values occur at (±1, 0) and the minimal values occur at (0, ±1). Example 2: Determine the point on the curve y = (1/2)(x 2 + 1) which is closest to the point (2, 0). Solution: We can set this up as an optimization problem over a restricted domain in the following way. We want to restrict ourselves to the curve y = (1/2)(x 2 + 1). This corresponds to the condition g(x, y) = 2y x 2 1 = 0. This is our constraint! But what are we optimizing? Well, we want to minimize the distance between the point (2, 0) and this curve. The formula for the distance between an arbitrary point (x, y) and the point (2, 0) is (x 2) 2 + y 2. This is what was want to minimize! In order to make this easier, however, we notice that the minimal/maximal points of (x 2) 2 + y 2 correspond to the minimal/maximal points of f(x, y) = (x 2) 2 + y 2 (see Figure 4). All together, we have minimize (x 2) 2 + y 2 subject to 2y x 2 1 = 0. We will solve this using the method of Lagrange multipliers. We initiate the function We have L(x, y, λ) = (x 2) 2 + y 2 + λ(2y x 2 1). L x (x, y, λ) = 2(x 2) 2λx L y (x, y, λ) = 2y + 2λ L λ (x, y, λ) = 2y x 2 1. Setting each of these equations equal to zero gives y = λ by the second equation and y = (1/2)(x 2 +1) by the third. It follows that λ = (1/2)(x 2 + 1) which, by the first equation, gives 2(x 2) 2( (1/2)(x 2 + 1))x = 0 = x 3 + 3x 4 = 0. This is a cubic expression, which is generally difficult to solve; however, we notice that the coefficients add to zero so that x = 1 must be a root. We have x 3 + 3x 4 = (x 1)(x 2 + x + 4) = 0. The remaining quadratic does 9

g(x,y)=2y-x 2-1=0 f(x,y)=(x-2) 2 +y 2 =C Figure 4: The minimal distance is obtained where the level curves of f(x, y) = (x 2) 2 + y 2 and the curve y = (1/2)(x 2 + 1) meet tangentially. not have any real roots, so that the only solution is x = 1. By the other expressions, this gives y = 1 and λ = 1. It follows that the point on the curve y = (1/2)(x 2 + 1) closest to the point (2, 0) is (x, y) = (1, 1). 10