3.3 Optimizing Functions of Several Variables 3.4 Lagrange Multipliers

3.3 Optimizing Functions of Several Variables 3.4 Lagrange Multipliers

3.3 Optimizing Functions of Several Variables 3.4 Lagrange Multipliers Prof. Tesler Math 20C Fall 2018 Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 1 / 56 Optimizing y = f (x) In Math 20A, we found the minimum and maximum of y = f (x) by using derivatives. First derivative: Solve for points where f 0(x) = 0. Each such point is called a critical point. Second derivative: For each critical point x = a, check the sign of f 00(a): f 00(a) > 0: The value y = f (a) is a local minimum. f 00(a) < 0: The value y = f (a) is a local maximum. f 00(a) = 0: The test is inconclusive. Also may need to check points where f (x) is defined but the derivatives aren’t, as well as boundary points. We will generalize this to functions z = f (x, y). Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 2 / 56 Local extrema (= maxima or minima) Consider a function z = f (x, y). The point (x, y) = (a, b) is a local maximum when f (x, y) 6 f (a, b) for all (x, y) in a small disk (filled-in circle) around (a, b); global maximum (a.k.a. absolute maximum) when f (x, y) 6 f (a, b) for all (x, y); local minimum and global minimum are similar with f (x, y) > f (a, b). A, C, E are local maxima (plural of maximum) E is the global maximum D, G are local minima G is the global minimum B is maximum in the red cross-section but minimum in the purple cross-section! It’s called a saddle point. Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 3 / 56 4 Critical points on a contour map 3 2 P ● Q ● ● S 1 1 0 ● 1 R 1 Classify− each point P, Q, R, S as local maximum or minimum, saddle point, or none. Isolated− max/min3 −2 usually−1 have0 small closed1 curves2 around3 them. Values decrease towards P, so P is a local minimum. Values increase towards Q, so Q is a local maximum. Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 4 / 56 4 Critical points on a contour map 3 2 P ● Q ● ● S 1 1 0 ● 1 R 1 The− crossing contours have the same value, 1. (If they have different values, the function is undefined at that point.) Here, the crossing contours give four regions around R. The function−3 has−2 −1 0 1 2 3 a local min. at R on lines with positive slope (goes from >1 to 1 to >1) a local max. at R on lines with neg. slope (goes from <1 to 1 to <1). Thus, R is a saddle point. Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 5 / 56 Critical4 points on a contour map 3 2 P ● Q ● ● S 1 1 0 ● 1 R 1 S is− a regular point. Its level curve ≈ 8 is implied but not shown. The values−3 are− bigger2 on−1 one side0 and1 smaller2 on the3 other. P: local min Q: local max R: saddle point S: none Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 6 / 56 Contour map of z = y=x: crossing lines 10 − − 7 − 3 7 2 3 2 − 1 5 1 −1/2 − 1/2 1/3 1/3 −1/7 1/7 0 0 0 1/7 −1/7 − 1/3 1/3 −1/2 1/2 5 − − 1 1 − − − 2 2 3 3 7 7 10 − −10 −5 0 5 10 Contours of z = y=x are diagonal lines: z = c along y = cx. Contours cross at (0, 0) and have different values there. Function z = y=x is undefined at (0, 0). Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 7 / 56 Contour map of z = sin(y) Minimum and maximum form curves, not just isolated points −1.00 4 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 2 1.00 0.75 0.50 0.25 0 0.00 −0.25 −0.50 −0.75 −1.00 2 − −0.75 −0.50 −0.25 0.00 0.25 0.50 4 0.75 − 1.00 −4 −2 0 2 4 Contours of z = f (x, y) = sin(y) are horizontal lines y = arcsin(z) 1 Maximum at y = (2k + 2 )π for all integers k 1 Minimum at y = (2k - 2 )π These are curves, not isolated points enclosed in contours. Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 8 / 56 Finding the minimum/maximum values of z = f (x, y) The tangent plane is horizontal at a local minimum or maximum: f (a, b) + fx(a, b)(x - a) + fy(a, b)(y - b)- z = 0. The normal vector fx(a, b), fy(a, b), -1 k z-axis when fx(a, b) = fy(a, b) = 0, or rf (a, b) = ~0. At points where rf , ~0, we can make f (x, y) larger by moving in the direction of rf ; smaller by moving in the direction of -rf . (a, b) is a critical point if rf (a, b) is ~0 or is undefined. These are candidates for being maximums or minimums. Critical points found in the same way for f (x, y, z,...). Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 9 / 56 Completing the squares review (x + m)2 = x2 + 2mx + m2 For a quadratic x2 + bx + c, take half the coefficient of x: b=2 Form the square: (x + b=2)2 = x2 + bx + (b=2)2 Adjust the constant term: x2 + bx + c = (x + b=2)2 + d where d = c -(b=2)2 Example: x2 + 10x + 13 Take half the coefficient of x: 10=2 = 5 Expand (x + 5)2 = x2 + 10x + 25 Add/subtract the necessary constant to make up the difference: x2 + 10x + 13 = (x + 5)2 - 12 Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 10 / 56 Completing the squares review For ax2 + bx + c, complete the square for a(x2 + (b=a)x) and then adjust the constant. Example: 10y2 - 60y + 8 10y2 - 60y + 8 = 10(y2 - 6y) + 8 y2 - 6y = (y - 3)2 - 9 10y2 - 60y + 8 = 10(y - 3)2 + ? 10(y - 3)2 = 10(y2 - 6y + 9) = 10y2 - 60y + 90 10y2 - 60y + 8 = 10(y - 3)2 - 82 Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 11 / 56 Critical points Let f (x, y) = x2 - 2x + y2 - 4y + 15 rf = h2x - 2, 2y - 4i rf = ~0 at x = 1, y = 2, so (1, 2) is a critical point. Use (x - 1)2 = x2 - 2x + 1 (y - 2)2 = y2 - 4y + 4 f (x, y) = (x - 1)2 + (y - 2)2 + 10 2 a 2 a 2 We “completed the squares”: x - ax = (x - 2 ) -( 2 ) f (x, y) > 10 everywhere, with global minimum 10 at (x, y) = (1, 2). Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 12 / 56 Second derivative test for functions of two variables How to classify critical points rf (a, b) = ~0 as local minima/maxima or saddle points Compute all points where rf (a, b) = ~0, and classify each as follows: Compute the discriminant at point (a, b): 2 2 @ f @ f @x2 @y @x 2 D = = fxx(a, b) fyy(a, b)-( fxy(a, b)) 2 2 @ f @ f @x @y @y2 Determinant of “Hessian matrix” at (x, y)=(a, b) | {z } If D > 0 and fxx > 0 then z = f (a, b) is a local minimum; If D > 0 and fxx < 0 then z = f (a, b) is a local maximum; If D < 0 then f has a saddle point at (a, b); If D = 0 then it’s inconclusive; min, max, saddle, or none of these, are all possible. Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 13 / 56 Example: f (x, y) = x2 - y2 Find the critical points of f (x, y) = x2 - y2 and classify them using the second derivatives test. rf = h2x, -2yi = ~0 at (x, y) = (0, 0). 2 The x = 0 cross-section is f (0, y) = -y 6 0. 2 The y = 0 cross-section is f (x, 0) = x > 0. It is neither a minimum nor a maximum. fxx(x, y) = 2 and fxx(0, 0) = 2 fyy(x, y) = -2 and fyy(0, 0) = -2 fxy(x, y) = 0 and fxy(0, 0) = 0 2 D = fxx(0, 0) fyy(0, 0)-(fxy(0, 0)) = (2)(-2)- 02 = -4 < 0 so (0, 0) is a saddle point Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 14 / 56 Example: f (x, y) = x2 - y2 rf = h2x, -2yi points in the direction of greatest increase of f (x, y). The function increases as we move towards the x-axis and away from the y-axis. At the origin, it increases or decreases depending on the direction of approach. Detailed direction General direction Contour plot of gradient of gradient 2 2 2 fx = 0: 2x = 0 fy = 0: ! 2y = 0 "f 1 1 1 fx < 0 fx > 0 (0,0) fy < 0 0 ! ! 0 0 fy > 0 1 1 1 − − − 2 2 2 − − − −2 −1 0 1 2 −2 −1 0 1 2 −2 −1 0 1 2 Prof. Tesler 3.3–3.4 Optimization Math 20C / Fall 2018 15 / 56 Example: f (x, y) = 8y3 + 12x2 - 24xy Find the critical points of f (x, y) and classify them using the second derivatives test.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    56 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us