ENGI 3424 4. 4 – Partial Differentiation Page 4-01 Partial Differentiation For functions of one variable, y f x , the rate of change of the dependent variable can dy f x . In this chapter we explore dx rates of change for functions of more than one variable, such as z f x, y . be found unambiguously by differentiation: Contents: 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 Partial Derivatives - introduction, chain rule, practice Higher Partial Derivatives, Clairaut’s theorem, Laplace’s PDE Differentials; error estimation; chain rule [again]; implicit functions; partial derivatives on curves of intersection The Jacobian - implicit and explicit forms; plane polar; spherical polar Gradient Vector, directional derivative, potential function, central force law Extrema; Second Derivative Test for z f x, y Lagrange Multipliers; nearest point on curve of intersection to given point Miscellaneous Additional Examples ENGI 3424 4.1 4.1 – Partial Derivatives Page 4-02 Partial Derivatives - introduction, chain rule, practice Example 4.1.1 At a particular instant, a cone has a height of h = 2 m and a base radius of r = 1 m. The base radius is increasing at a rate of 1 mm/s. The height is constant. How fast is the volume V increasing at this time? V 1 2 r h 3 We need dV . dt h = const. V is a function of r only. dV dV dr dt dr dt chain rule 1 d 2 dr 2 dr r h rh 3 dr dt 3 dt 2 1 3 1 1 2 ms 3 1000 Therefore dV dt 750 m3s1 0.00419 m3s1 dr dh 1 mms1 and 2 mms1, dt dt dV how do we find ? dt We shall return to this question later. But if 4.1 – Partial Derivatives ENGI 3424 Page 4-03 Graph of V against r and h : Plotting z = V (where V = r 2h / 3) against both x = r and y = h yields The cross-section of this surface in the vertical plane h = 2 is The cross-section of this surface in the vertical plane r = 1 is V V lim r 0 r r V V lim h 0 h h V r r , h V r , h r 0 r lim 1 3 r 2 r r 0 lim r 0 2r r r h 13 r 2 h 2 2 rh 3 4r 3 1 h r 3 at h 2 V r , h h V r , h h 0 h 2 1 3r lim lim 2 rh 3 4.1 – Partial Derivatives ENGI 3424 Page 4-04 V . r V The tangent line to the surface in a cross-section (r = constant) has a slope of . h At each point on the surface, these two tangent lines define a tangent plane. The tangent line to the surface in a cross-section (h = constant) has a slope of V is a function of r and h, each of which in turn is a function of t only. In this case, the chain rule becomes dV V dr V dh dt r dt h dt In example 4.1.1, V 2 4 V 1 1 rh , r2 , r 3 3 h 3 3 dV 4 1 2 dr 1 dh 2 , m3 s1 dt 1000 dt 1000 dt 3 1000 3 1000 1500 r = 1, h = 2, Alternative notations: V Vr Dr V V r , h r r If w = f (x, y, z), then f x, y y, z f x, y, z w lim , etc. y 0 y y A Maple worksheet, used to generate the graph of V r , h 1 r 2h , 3 is available at "http://www.engr.mun.ca/~ggeorge/3424/demos/conevolume.mws". Open this worksheet in Maple and click on the graph. Then, by dragging the mouse (with left button down), one can change the direction of view of the graph as one wishes. Other features of the graph may be changed upon opening a menu with a right mouse click on the graph or by using the main menu at the top of the Maple window. 4.1 – Partial Derivatives ENGI 3424 Page 4-05 Example 4.1.2 f x, y, z x2 y 2 z 2 x2 y 2 z 2 1/2 Find f z 0,3, 4 [the first partial derivative of f with respect to z, evaluated at the point (0, 3, 4)]. Apply the general differentiation rule d dx f x n f x n 1/2 f 1 x2 y 2 z 2 x2 y 2 z 2 z 2 z 1 z 0 0 2z 2f f f z 0, 3, 4 4 4 5 0 9 16 OR f 2 x2 y 2 z 2 Using implicit differentiation, 2 f 2 x y2 z2 z z f 2f 0 0 2z z fz z 4 , f 5 as before In this example, f = (distance of the point (x, y, z) from the origin). n1 f x : 4.1 – Partial Derivatives ENGI 3424 Page 4-06 Example 4.1.3 u x y/ z Find the three first partial derivatives, ux , u y , uz . y/ z x x d n x n x n1 dx y 1 y x z z ux y y x z x 1 z y y z / z yu x z xz y u x y / z exp ln x z uy 1 y u ln x exp ln x ln x z z z uy 1 y/ z x ln x z OR ln u y ln x z 1 1 u y ln x u z ln u yz 1 ln x y ln u ln x y y z uy u ln x z 1 u z y 1z 2 ln x u uz uy y ln x 2 x y / z ln x 2 z z 4.2 – Higher Partial Derivatives ENGI 3424 4.2 Page 4-07 Higher Partial Derivatives, Clairaut’s theorem, Laplace’s PDE ux u x u 2u u xx x x x2 u 2u ux y y x y x 2u 3u ux y z z y x z y x 2u 3u ux y y y y x y2 x etc. Example 4.2.1 u x et sin y Find the second partial derivatives uxy , u yx , uxx and the third partial derivative uttt . ux et sin y ut x et sin y u u y x et cos y utt u t u u xy uttt u t u ux et cos y y Therefore u yx uxx 0 uy x et cos y u xy uttt x et sin y 4.2 – Higher Partial Derivatives ENGI 3424 Page 4-08 Clairaut’s Theorem If, on a disk D containing the point (a, b), f is defined and both of the partial derivatives f xy and f yx are continuous, (which is the case for most functions of interest), then f xy a, b f yx a, b that is, the order of differentiation doesn’t matter. One of the most important partial differential equations involving second partial derivatives is Laplace’s equation, which arises naturally in many applications, including electrostatics, fluid flow and heat conduction: 2u 2u 0 x2 y2 3 or its equivalent in : 2u 2u 2u 0 x2 y2 z2 Example 4.2.2 Does u ln x 2 y 2 satisfy Laplace’s equation? u ln x 2 y 2 ux 1/2 12 ln x y 2 2 using 1 2x 0 x 2 2 2 2 x y x y2 u xx 1 x 2 y 2 x 2 x 0 x2 y 2 2 using ln x n n ln x y 2 x2 x2 y 2 2 f x d ln f x dx f x [using the quotient rule] u is symmetric with respect to x, y. Therefore, to find u yy , interchange x, y in u xx . uy y x2 y 2 y 2 x 2 2 u xx uxx u yy 0 Therefore u does satisfy Laplace’s equation (except at (0, 0)). ENGI 3424 4.3 In 4.3 – Differentials Page 4-09 Differentials; error estimation; chain rule [again]; implicit functions; partial derivatives on curves of intersection 2 , let a curve have the Cartesian equation y = f (x). The small change in y, ( y ), caused by travelling along the curve for a small horizontal distance x , may be approximated by the change dy that is caused by travelling for the same horizontal distance x along the tangent line instead. The exact form is y f x x f x . The approximation to y is y dy f x dx where the increment x has been replaced by the differential dx. The approximation improves as x decreases towards zero. Stepping up one dimension, let a surface have the Cartesian equation z = f (x, y). The change in the dependent variable z caused by small changes in the independent variables x and y has the exact value z f x x, y y f x, y . The approximation to z is z dz f f dx dy x y Example 4.3.1 A rectangle has quoted dimensions of 30 cm for length and 24 cm for width. However, there may be an error of up to 1 mm in the measurement of each dimension. Estimate the maximum error in the calculated area of the rectangle. Let A = area, L = length and W = width. Length = (30 ± 0.1) cm L = 30 and L = 0.1 Width = (24 ± 0.1) cm W = 24 and W = 0.1 A = LW dA A A dL dW W dL L dW L W 4.3 – Differentials ENGI 3424 Example 4.3.1 (continued) Let dL = dW = 0.1, then max(error) = A ≈ dA = 24 0.1 + 30 0.1 = 5.4 cm2 . Compare this to a direct calculation: max error max A max A , A Amin A Amin 30 24 30 0.1 24 0.1 = 5.39 cm2 . Amax A 30 0.1 24 0.1 30 24 = 5.41 cm2 . Therefore max(error) = 5.41 cm2 . Relative error: relative error in L = L 0.1 1 (one-third of one percent) L 30 300 relative error in W = W 0.1 1 W 24 240 A = LW dA = W dL + L dW dA W dL L dW A LW LW dA dL dW 1 1 45 3 A L W 300 240 1200 400 A dA 0.75% A A and 0.75% of A = 720 cm2 is 5.4 cm2 . Page 4-10 ENGI 3424 4.3 – Differentials Page 4-11 Chain Rule z f x, y . If x and y are both functions of t only, then, by the chain rule, dz z dx z dy dt x dt y dt If z f x, y and y in turn is a function of x only, then replace t by x in the formula above. dx 1 and dx dz z z dy dx x y dx Note the distinction between the total derivative z dz and the partial derivative . dx x 4.3 – Differentials ENGI 3424 Page 4-12 Example 4.3.2 In the study of fluid dynamics, one approach is to follow the motion of a point in the fluid. In that approach, the velocity vector is a function of both time and position, while position, in turn, is a function of time. v v r, t and r r t . The acceleration vector is then obtained through differentiation following the motion of the fluid: dv v v d x v d y v d z a t dt t x dt y dt z dt dv v or, equivalently, a t v v dt t [The gradient operator, , will be introduced later, on page 4-21.] Further analysis of an ideal fluid of density at pressure p subjected to a force field F leads to Euler’s equation of motion v p v v F t This application of partial differentiation will be explored in some majors in a later As a simple example here, suppose that v e x 1 10 1 t , then find the acceleration vector. T semester. First note that the velocity vector is the derivative of the displacement vector, so that dx dr v dt dt v t 0 dz dt T 0 0 0 T e x 1 10 1 t v e x x 0 10 , v v y z a t dy dt 0 0 T T T dv v v d x v d y v d z dt t x dt y dt z dt dv dt 0 0 10 T e x 0 0 e x 0 0 e2 x T [One can show that x t ln t c , where c is a constant.] 0 10 T 4.3 – Differentials ENGI 3424 Page 4-13 Generalized Chain Rule Let z be a function of n variables x1, x2 , , xn , each of which, in turn, is a function of m variables t1, t2 , , tm , so that z f x1 t1 , t2 , , tm , x2 t1 , t2 , , tm . , xn t1 , t2 , To find , tm , z , ti trace all paths that start at z and end at ti , via all of the dz z dx j j 1 x j n and z ti x j variables. z xj j 1 j ti n x i 1, 2, , m Example 4.3.3: u x y yz zx , x st , y est and z t 2 . Find us in terms of s and t only. Find the value of us when s = 0 and t = 1. u u x u y s x s y s [There is no z term because z is not a function of s.] u y 0 z t x z 0 t e st s t est t 2 st t 2 est t 3 t 1 st t 2 est This derivative could also be found directly by replacing x, y and z by the respective functions of s and t before differentiating u: st t est t est t t 1 t u st est est t 2 t 2 st us 2 2 3 us 0,1 1 11 0 1 e0 1 2 3 . 3 t 1 st t 2 e st 4.3 – Differentials ENGI 3424 Page 4-14 Implicit functions: If z is defined implicitly as a function of x and y by F x, y, z c , then dF Fx dx Fy dy Fz dz 0 dz 1 Fx dx Fy dy Fz provided Fz F 0 z Example 4.3.4: Find the change in z when x and y both increase by 0.2 from the point (1, 2, 2) on the sphere x2 y 2 z 2 9 . F x 2 y 2 z 2 9 dz 1 1 2 x dx 2 y dy x dx y dy 2z z Solution − Approximate motion on the sphere by motion on the tangent plane: x = 1, y = z = 2, z dz dx ≈ Δx = 0.2 , dy ≈ Δy = 0.2 . 1 1 0.2 2 0.2 0.3 2 Therefore z decreases by [approximately] 0.3 Exact: zold 9 12 22 znew 9 1.2 2.2 2 4 2, 2 Therefore Δz = −0.3507... 2.72 1.649 4.3 – Differentials ENGI 3424 Page 4-15 Curves of Intersection Example 4.3.5: Find both partial derivatives with respect to z on the curve of intersection of the sphere centre the origin, radius 5, and the circular cylinder, central axis on the y-axis, radius 3. Sphere: f = x2 + y2 + z2 = 25 Cylinder: g = x2 df = 2x dx + 2y dy + 2z dz = 0 and dg = 2x dx + z2 = 9 + 2z dz = 0 which leads to the linear system x y dx 1 x 0 dy 1 z dz 1 dx x y 1 z 0 y 1 z dz dz x 1 xy x dy x 0 1 z y z 1 dz dz xy 0 x 0 Therefore z dx dz and dy 0 dz x x z y and 0 z x z [The intersection is the pair of circles x2 + z2 = 9, y = 4 . Because y never changes on each circle, x is actually a function of z only.] 4.3 – Differentials ENGI 3424 Page 4-16 Example 4.3.6 A surface is defined by f x, y, z xz y 2 z z 1 . Find z . y Implicit method: df f f f dx dy dz x y z 0 z dx 2 yz dy x y 2 1 dz But f 1 x y2 1 z dz z dx 2 yz dy z 1 dz z 2 dx 2 y dy In the slice in which the partial derivative z is evaluated, x is constant y dx = 0. z z 2 0 2 y 2 yz 2 y Explicit method: z x y 2 1 1 2 z x y 2 1 0 2 y 0 2 yz 2 y z2 In general, if a dx b dy c dz then z a z (because y is constant and dy = 0 in the slice in which is evaluated) and x c x z b z (because x is constant and dx = 0 in the slice in which is evaluated). y c y 4.4 – The Jacobian ENGI 3424 4.4 Page 4-17 The Jacobian - implicit and explicit forms; plane polar; spherical polar The Jacobian is a conversion factor for a differential of area or volume between one orthogonal coordinate system and another. Let x, y , u, v be related by the pair of simultaneous equations f x, y, u, v c1 g x, y, u, v c2 df f x dx f y dy fu du fv dv 0 and dg g x dx g y dy gu du gv dv 0 fx f y dx f u g y dy gu gx A fv du gv dv B dx 1 du A B dy dv which leads to dA dx dy x, y du dv u, v where the Jacobian is x, y det B u, v det A The Jacobian for the transformation from x, y to u, v is also the magnitude of the cross product of the tangent vectors that define the boundaries of the element of area, so that x, y r r u, v u v 4.4 – The Jacobian ENGI 3424 Page 4-18 Example 4.4.1 Transform the element of area dA dx dy to plane polar coordinates. x r cos , y r sin . f x r cos 0 g y r sin 0 df 1 dx 0 dy cos dr r sin d 0 and dg 0 dx 1 dy sin dr r cos d 0 1 0 dx cos r sin dr 0 1 dy sin r cos d B A x, y r , B A r cos 2 r sin 2 1 r r if r 0 Therefore dA r dr d Geometrical derivation of dA : element of arc length r d If x, y can be written as explicit functions of (u, v), then an explicit form of the Jacobian is available: x, y u, v x u y u x v y v The Jacobian can also be used to express an element of volume in terms of another orthogonal coordinate system: x, y, z dV dx dy dz du dv dw u, v, w 4.4 – The Jacobian ENGI 3424 Page 4-19 Spherical Polar Coordinates The “declination” angle is the angle between the positive z axis and the radius vector r . 0 . The “azimuth” angle is the angle on the x-y plane, measured anticlockwise from the positive x axis, of the shadow of the radius vector. 0 2 . z r cos The shadow of the radius vector on the x-y plane has length r sin . It then follows that x r sin cos and y r sin sin . Example 4.4.2 Express the element of volume dV x r sin cos r y r sin sin z r cos Using the explicit form, x, y , z r , , xr x x yr y y zr z z in spherical polar coordinates, sin cos sin sin cos r cos cos r cos sin r sin r sin sin r sin cos 0 Expanding along the last row of the determinant, x, y , z cos r 2 sin cos cos2 sin 2 r sin r sin 2 cos2 sin 2 0 r, , r 2 sin cos2 sin 2 r 2 sin Note that sin 0 because 0 . Therefore dV r 2 sin dr d d ENGI 3424 4.4 – The Jacobian For a transformation from Cartesian to plane polar coordinates in x, y r so that dA dx dy r dr d r , Page 4-20 2 , For cylindrical polar coordinates in 3 , x, y , z r dV r dr d dz r , , z Explicit method for plane polar coordinates: x r cos , y r sin x r x, y ABS det r , y r x y cos sin r sin r cos r cos2 r sin 2 r . Implicit method for plane polar coordinates [Example 4.4.1]: f x r cos 0 df dx cos dr r sin d 0 g y r sin 0 dg dy sin dr r cos d 0 1 0 dx cos r sin dr 0 1 dy sin r cos d A B B x, y r cos 2 r sin 2 r r r , A 1 Note that for spherical polar coordinates r , , there is no agreement among textbooks as to which angle is and which angle is . In this course we adopt as the angle between the positive z axis and the radius vector r . You are likely to encounter textbooks and software in which that same angle is labelled as . 4.5 – The Gradient Vector ENGI 3424 4.5 Page 4-21 Gradient Vector, directional derivative, potential function, central force law Let F F r and r r t . dF F dx F dy F dz dt x dt y dt z dt x y T dr F dt z dF dr F dt dt = “del” or “nabla” = gradient operator F = gradient vector Directional Derivative The rate of change of the function F at the point Po in the direction of the vector a aaˆ a 0 is Daˆ F P F P aˆ o o The maximum value of the directional derivative of F at any point Po occurs when the vector a is parallel to the gradient vector F . Also, the vector Ν F is normal to the surface defined by F r constant. [Interpretation of the gradient vector: The gradient vector is in the plane of the dependent variables. Its direction at any point is the direction in which one must travel in order to experience the greatest possible rate of increase of the dependent variable at that point. Its magnitude is that greatest possible rate of increase.] 4.5 – The Gradient Vector ENGI 3424 Page 4-22 Example 4.5.1 The temperature in a region within 10 units of the origin follows the form T r er , where r x 2 y 2 z 2 . Find the rate of temperature change at the point (−1, −1, +1) in the direction of the vector 1 0 0 . T T and r are symmetric with respect to x, y, z . T dT r x dr x dT d r e r 1 r e r dr dr 1/ 2 r 1 x x2 y 2 z 2 2x 0 0 x 2 r T x 1 r e r x r By symmetry, it then follows that T y T z 1 r e r and 1 r e r y r z r 1 r r T T e x y z r At 1, 1, 1 , r 111 3 T 1 3 3 T e 1 1 1 3 aˆ ˆi DaT P 1 1 3 1 3 T ˆi e 3 1 1 0 0 3 1 3 e 0.0748 Km 1 3 [Note that, in this example, the temperature distribution is spherically symmetric about the origin, with a minimum of zero at the origin, rising to a maximum of 1/e = 0.368... one metre away from the origin and falling asymptotically back to zero as r ∞. Outside the r = 1 sphere, the gradient vector points radially inwards. At (−1, −1, 1) the gradient vector has a magnitude of approximately 0.104 K m−1.] 4.5 – The Gradient Vector ENGI 3424 Page 4-23 Central Force Law If r is the potential function for some force per unit mass or force per unit charge F r , then F (or, in some cases, F ). For a central force law, the potential function is spherically symmetric and is dependent only on the distance r from the origin. When the central force law is a simple power law, k r n . r x2 y 2 z 2 d r x dr x k n r n1 kn x 1/2 1 2 x y2 z 2 2x 0 0 2 r n1 kn x r n2 r By symmetry, kn y r n2 y kn r and x y z n 2 kn z r n2 z kn r n2 r But r r rˆ Therefore F kn r n1 rˆ Examples include the inverse square laws, for which n = −1: Electromagnetism: Q Q Q k , , F rˆ 4 4 r 4 r 2 Gravity: k GM , GM GM , F rˆ r r2 4.5 – The Gradient Vector ENGI 3424 Page 4-24 Some Applications of the Gradient Vector: (1) The directional derivative D at the point Po xo , yo , zo is maximized by F r P . choosing a to be parallel to F at Po , so that Daˆ F o Po (2) A normal vector to the surface F x, y, z c at the point Po xo , yo , zo is N F r P . o (3) The equation of the line normal to the surface F x, y, z c at the point Po xo , yo , zo is r OPo t F Po (4) o Po The equation of the tangent plane to the surface F x, y, z c at the point Po xo , yo , zo is r OPo (5) r t F F P r r F P 0 o o o If the point Po xo , yo , zo lies on both of the surfaces F x, y, z c and G x, y, z k , then the acute angle of intersection of the surfaces at the point is given by cos F G Po F Po Po G Some of these features are applied in the problem sets. Po ENGI 3424 4.6 4.6 – Extrema; Second Derivative Test Page 4-25 Extrema; Second Derivative Test for z f x, y Much of differential calculus in the study of maximum and minimum values of a function of one variable carries over to the case of a function of two (or more) variables. In order to visualize what is happening, we shall restrict our attention to the case of functions of two variables, z f x, y . For a function f x, y defined on some domain D in 2 , the point P xo , yo is a critical point [and the value f xo , yo is a critical value] of f if 1) P is on any boundary of D; or f xo , yo is undefined; or 2) 3) f x and/or f y is undefined at P; or 4) f x and f y are both zero at P ( f 0 at P). A local maximum continues to be equivalent to a “hilltop”, while a local minimum continues to be equivalent to a “valley bottom”. “Local extremum” is a collective term for local maximum or local minimum. Instead of tangent lines being horizontal at critical points of type (4), we now have tangent planes being horizontal at critical points of type (4). At any local extremum at which f x, y is differentiable, the tangent plane is horizontal, f x f y 0 and f 0 . The converse is false. f 0 does not guarantee a local extremum. There could be a saddle point (the higher dimensional equivalent of a point of inflection) instead. 4.6 – Extrema; Second Derivative Test ENGI 3424 Page 4-26 Example 4.6.1 Find and identify the nature of the extrema of f x, y x 2 y 2 4 x 6 y . Polynomial functions of x and y are defined and are infinitely differentiable on all of Therefore the only critical points are of type (4). 2x 4 f 2y 6 f 0 But x, y 2, 3 only. f x, y x 2 4 y 3 9 2 2 0 4 0 9 13 f 2, 3 Therefore the only local extremum is a minimum value of −13 at (−2, 3). It is also an absolute minimum. Second Derivative Test To determine the nature of a critical point: 1) Examine the values of f in the neighbourhood of P; or 2) [First derivative test:] Examine the changes in f x and f y at P; or 3) Use the second derivative test: At all points (a, b) where f 0 , find all second partial derivatives, then find f xx f xy D (the “Hessian” determinant) f yx f yy and evaluate D at (x, y) = (a, b). D a, b 0 and f xx a, b 0 a relative minimum of f is at (a, b) D a, b 0 and f xx a, b 0 a relative maximum of f is at (a, b) D a, b 0 a saddle point of f is at (a, b) D a, b 0 test fails (no information). 2 . 4.6 – Extrema; Second Derivative Test ENGI 3424 Note that D a, b 0 Therefore D 0 f xx f yy f xy f yx and f xy f yx f xy Page 4-27 2 0 f xx f yy 0 f xx , f yy must have the same sign at an extremum. One can therefore check the sign of whichever of f xx or f yy is easier to evaluate in the second derivative test, when determining whether an extremum is a maximum or a minimum. Example 4.6.1 (again): Find all extrema of f x, y x 2 y 2 4 x 6 y . Any critical points will be of type (4) only. 2x 4 f 0 2y 6 D f xx f xy f yx f yy x, y 2 0 0 2 2, 3 only. 4 0 x, y D 0 and f xx 0 at (2, 3) there is a relative minimum at (2, 3) and the minimum value is f (2, 3) = 13. As there are no other critical points, f x, y has an absolute minimum value of 13 at (2, 3) and has no maxima. [ z f x, y is a circular paraboloid, vertex at (2, 3, 13) and axis of symmetry parallel to the z-axis.] 4.6 – Extrema; Second Derivative Test ENGI 3424 Page 4-28 Example 4.6.2 Find all extrema of f x, y 2 x3 x y 2 5x 2 y 2 . f x, y is a polynomial function of x and y any critical points will be of type (4) only. 6 x 2 y 2 10 x f 2 xy 2 y f 0 2 6 x 2 10 x y 2 0 and 1 2 y x 1 0 2 y 0 or x 1 y 0 in 1 2 x 3x 5 0 x 0 or x 5 3 x 1 in 1 6 10 y 2 0 y2 4 y 2 The only critical points are x, y 5 0, 0 , , 0 , 1, 2 and 1, 2 . 3 f x 6 x 2 y 2 10 x and f y 2 y x 1 D f xx f xy f yx f yy 12 x 10 2y 2y 2 x 1 4.6 – Extrema; Second Derivative Test ENGI 3424 Page 4-29 Example 4.6.2 (continued) z f 0,0 0 At (0, 0): D 10 0 0 20 0 2 D 0 and f xx 10 0 At 53 ,0 : z 2 53 3 minimum 0 5 53 2 53 5 53 D 12 53 10 2 0 2 53 1 0 2 0 25 10 15 125 9 3 27 10 0 0 43 40 0 3 D 0 and f xx 0 maximum At 1, 2 : z f 1, 2 2 1 1 2 5 1 2 2 2 4 5 4 3 D 2 4 4 0 0 4 16 0 2 D 0 saddle point Therefore the critical points are Minimum at 0, 0, 0 Maximum at 53 , 0, 125 27 Saddle points at 1, 2, 3 and 1, 2, 3 Slices y=0 and x=0 2 2 4.6 – Extrema; Second Derivative Test ENGI 3424 Example 4.6.3 Find all extrema of z f x, y x 2 y 2 Again this function is a polynomial function of x and y so that the only critical points occur where f 0 . 2x f 2 y f 0 x, y 0, 0 only. f 0, 0 0 D f xx f xy f yx f yy 2 0 0 2 0 Therefore the only critical point is a saddle point at (0, 0, 0). The surface is an hyperbolic paraboloid. Page 4-30 ENGI 3424 4.6 – Extrema; Second Derivative Test Page 4-31 Example 4.6.4 Find and identify the nature of the extrema of f x, y 1 x2 y 2 . The domain of f x, y is the circle x 2 y 2 1 and all points inside it. f x, y 1 x 2 y 2 1/ 2 1 2 x f x, y 2 1 x2 y 2 1 x 2 y 2 2 y T x 1 x2 y 2 y 1 Inside the domain, f and its partial derivatives are well defined everywhere, except that the gradient diverges everywhere on the boundary. Therefore the only critical points to consider are types (1), (3) and (4). Type (4) [zero gradient]: Inside the domain, f 0 x, y 0, 0 only. f 0, 0 1 However, 0 1 x2 y 2 1 everywhere else in the domain f x, y f 0, 0 everywhere else in the domain. there is an absolute maximum at (0, 0, 1). Types (3) [undefined gradient] and (1) [the boundary]: Everywhere on the boundary, 1 x2 y 2 1 1 0 and 0 f x, y everywhere else in the domain. the absolute minima are all points on the circle x2 + y2 = 1, z = 0. [The surface is the upper half of the sphere x2 + y2 + z2 = 1 .] ENGI 3424 4.7 4.7 – Lagrange Multipliers Page 4-32 Lagrange Multipliers; nearest point on curve of intersection to given point In order to obtain an appreciation for the geometric foundation for the method of Lagrange multipliers, we shall begin with an example that could be solved in another way. Example 4.7.1 A farmer wishes to enclose a rectangle of land. One side is a straight hedge, more than 30 m long. The farmer has a total length of 12 m of fencing available for the other three sides. What is the greatest area that can be enclosed by the available fencing? The function to be maximized is the area enclosed by the fencing and the hedge: A x, y x y The constraint is the length of fencing available: L x, y x 2 y 12 There are additional constraints. Neither length may be a negative number. Therefore any solution is confined to the first quadrant of the x, y graph. Superimpose the graph of the constraint function L(x, y) = 12 on the contour graph of the function z = A(x, y) : The least value of A(x, y) is zero, on the coordinate axes. At (0, 6), two 6-metre segments of fence are touching, enclosing zero area. At (12, 0), all of the fence is up against the hedge, enclosing zero area. 4.7 – Lagrange Multipliers ENGI 3424 Page 4-33 Example 4.7.1 (continued) As one travels along the constraint line L = 12 from one absolute minimum at (0, 6) to the other absolute minimum at (12, 0), the line first passes through increasing contours of A(x, y), A 6 2 7, 3 7 4 A 6 18, 3 4.5 9 A 6 34, 3 8.5 1 A(4, 4) = 16 until, somewhere in the vicinity of (6, 3), the area reaches a maximum value, then declines, (for example, A(8, 2) = 16), back to the other absolute minimum at (12, 0). At the maximum, the graph of L(x, y) = 12 just touches a contour of A(x, y). The two graphs share a common tangent there. gradients are parallel A L y 1 x 2 Therefore solve the system of simultaneous equations y = x = 2 x + 2y = 12 Solution: (the constraint) (x, y) = (6, 3). From the graph, A is a maximum at (6, 3). Amax = A(6, 3) = 63 = 18 m2 . is the Lagrange multiplier. ENGI 3424 4.7 – Lagrange Multipliers Page 4-34 To maximize f x, y subject to the constraint g x, y k : As one travels along the constraint curve g x, y k , the maximum value of f x, y occurs only where the two gradient vectors are parallel. This principle can be extended to the case of functions of more than two variables. General Method of Lagrange Multipliers To find the maximum or minimum value(s) of a function f x1 , x2 , , xn subject to a constraint g x1 , x2 , , xn k , solve the system of simultaneous (usually non-linear) equations in (n + 1) unknowns: f g g = k where is the Lagrange multiplier. Then identify which solution(s) gives a maximum or minimum value for f. This can also be extended to the case of more than one constraint: In the presence of two constraints g x1 , x2 , , xn k and h x1 , x2 , the system in (n + 2) unknowns: f g h g = k h = c , xn c , solve 4.7 – Lagrange Multipliers ENGI 3424 Page 4-35 Example 4.7.2 Find the points, on the curve of intersection of the surfaces x y 2 z 6 and 2x2 y 2 z 2 , that are nearest / farthest from the origin. The maximum and minimum values of distance d occur at the same place as the maximum and minimum values of d 2 . [Differentiation of d 2 will be much easier than differentiation of d.] The function to be maximized/minimized is f x, y, z d 2 x 2 y 2 z 2 The constraints are g x, y, z x y 2 z 6 and h x, y, z 2 x 2 2 y 2 z 2 0 f g h and 2x 2 y 2z T 1 1 2 T 2 x 1 2 (1) 2 y 1 2 (2) 2 z 1 2 (3) x y 2z 6 (4) 2 x2 2 y 2 z 2 0 (5) 4 x 4 y 2 z (1) (2) 2 x y 1 2 0 y x or 2 1 . Case 2 = 1: (1) or (2) 0 (3) z 0 [or 1 , which contradicts 2 1 .] T Note that f, g and h are all symmetric with respect to (x, y). It then follows that, at any critical point, y = x. Equation (2) is redundant, which allows for a faster solution than is shown here. 4.7 – Lagrange Multipliers ENGI 3424 Example 4.7.2 (continued) (5) 2 x2 y 2 0 But x, y 0, 0 (4) 0 + 0 0 = 6 only. - impossible! Therefore 2 1 . Case y = x: (4) 2 x 2 z 6 z x 3 (6) (5) 4 x 2 x 3 0 2 4 x2 x2 6 x 9 0 3 x 2 2 x 3 0 3 x 3 x 1 0 x 3 or x 1. x 3 y 3 (6) z 6 f 3, 3, 6 3 3 6 2 2 2 d 2 9 1 1 4 54 . x 1 y 1 (6) z 2 f 1, 1, 2 12 12 2 2 d 2 11 4 6 . These are the only critical points. Therefore The nearest point is (1, 1, 2) and the farthest point is (3, 3, 6). [The surfaces are a plane and a right circular cone. The curve of intersection is an ellipse.] Page 4-36 4.8 – Additional Examples ENGI 3424 4.8 Page 4-37 Miscellaneous Additional Examples Example 4.8.1 A window has the shape of a rectangle surmounted by a semicircle. Find the maximum area of the window, when the perimeter is constrained to be 8 m. The function to be maximized is A r, h 2rh 12 r 2 The constraint is the perimeter function P r, h h 2r h r 2h 2 r 8 Single variable method: P 8 h 8 2 r 2 4 2 A r r 8 2 r 12 r 2 8r r 2 dA 8 4 r dr dA 8 0 r only. dr 4 The only other critical points are on the domain boundaries, at r = 0 (when A = 0, clearly an absolute minimum) and at h = 0 (when A 12 r 2 ). Inside the domain, r > 0 and h > 0 A > 0 (and A is differentiable throughout). Therefore A must be at either a maximum or a point of inflexion at r 8 . 4 4.8 – Additional Examples ENGI 3424 Example 4.8.1 (continued) d2A 8 0 4 0 maximum at r . 2 dr 4 At the maximum, h 8 2 r 8 4 2 8 2 2 4 4 88 32 4 8 4.48 m2 4 4 2 4 2 Amax The maximum area occurs when r h 8 1.12 m . 4 Lagrange Multiplier Method: A r, h 2rh 12 r 2 P r, h h 2r h r 2h 2 r 8 A P 2h r 2 2r 2 2h r 2 (1) 2r 2 (2) and 2h 2 r 8 (3) Page 4-38 4.8 – Additional Examples ENGI 3424 Page 4-39 Example 4.8.1 (continued) (2) r (1) becomes 2h r r 2r 2h 2r hr. (3) Therefore 4 r 8 r h 8 1.12 m . 4 88 32 4 8 4.48 m2 4 4 2 4 2 At this critical point, A The ends of the constraint line are at At B, r, h 8 B 0, 4 , C , 0 . 2 A Amin 0 1 8 32 At C , A 3.80 m2 2 2 2 2 A > 0 and differentiable at all points between B and C. 2 Therefore the maximum area of 8 32 1.12 m . 4.48 m2 occurs at r h 4 4 4.8 – Additional Examples ENGI 3424 Page 4-40 Example 4.8.2 Find the local and absolute extrema of the function f x, y 3 x2 y2 . f x2 y 2 1/3 2/3 f 1 2x x2 y 2 2 x 0 2 x 3 3 3 x2 y 2 By symmetry, f 2y 2 y 3 3 x2 y2 f is continuous on all of 2 , (therefore there is no boundary to check and no critical points of types (1) or (2)), but f x and f y as x, y 0,0 (critical point of type (3)). f x and f y are not both zero everywhere else (no critical points of type (4)). Therefore (0, 0) is the only critical point. But f 0,0 0 and f x, y 0 for all x, y except (0, 0). Therefore the only critical point is an absolute minimum value of 0 at (0, 0). [There is a cusp at the origin.] [Any vertical cross-section containing the z axis.] ENGI 3424 4.8 – Additional Examples Example 4.8.3 Find the maximum and minimum values of the function V x, y 48x y 32 x3 24 y 2 in the unit square 0 x 1, 0 y 1. [The full solution to this question is available on the course web site, at "www.engr.mun.ca/~ggeorge/3424/demos/ex483.html".] 32 V x, y 2 , with the absolute maximum of V at x, y 12 , 12 and the absolute minimum of V at x, y 1, 0 . Page 4-41 4.8 – Additional Examples ENGI 3424 Page 4-42 Example 4.8.4 A hilltop is modelled by the part of the elliptic paraboloid x2 y2 h x, y 4000 1000 250 that is above the x-y plane. At the point P(500, 300, 3390), in which direction is the steepest ascent? x y h 500 125 T 12 h P 1 5 T Therefore the steepest ascent is in the direction of the vector 5 12 Note that this vector does not point directly at the summit. The summit is on the z axis. From the point P(500, 300, 3390), the summit is in the direction [5, 3] T. 4.8 – Additional Examples ENGI 3424 Page 4-43 Example 4.8.5 2 2u 1 2 u Show that u x, t f x ct f x ct satisfies . c t 2 x2 2 Let r = x ct and s = x + ct Then u u r u s t r t s t 1 df 1 df c df df 0 c 0 c 2 dr 2 ds 2 dr ds ut r ut s utt r t s t c d2 f d2 f c2 d 2 f d2 f 2 0 c 0 2 c 2 dr ds 2 dr 2 ds 2 u u r u s 1 df 1 df 1 1 x r x s x 2 dr 2 ds u xx Therefore 1 d2 f 1 d2 f 1 2 2 1 1 2 utt 2 2 2 dr 2 ds c utt c 2uxx . 1 f x ct f x ct satisfies the wave equation 2 - and f r can be any twice differentiable function of r ! [Thus u x, t This function models a pair of identical wave forms, moving at speed c in opposite directions without any attenuation.] [END OF CHAPTER 4]