Section 26: Directional Derivatives and the Gradient Vector Recall that if f is a differentiable function of x and y and z = f(x, y), then the partial derivatives f x (x, y) and f y (x, y) give the rate of change of z in the direction of x and y, respectively Suppose we want to find the rate of change of z in the direction of an arbitrary unit vector u, u 2 Consider the surface S defined by z = f(x, y) and let z 0 = f(x 0, y 0 ) so that P = (x 0, y 0, z 0 ) lies on S The vertical plane passing through (x 0, y 0, z 0 ) in the direction of u intersects S in a curve C The slope of the tangent line to C at P is the rate of change of z in the direction of u Figure : Illustration of the directional derivative Definition: The directional derivative of f at (x 0, y 0 ) in the direction of a unit vector u, u 2 is f(x 0 + u h, y 0 + u 2 h) f(x 0, y 0 ) D u f(x 0, y 0 ) = lim h 0 h provided this limit exists Theorem: If f is a differentiable function of x and y, then f has a directional derivative for any unit vector u, u 2 and D u f(x, y) = f x (x, y)u + f y (x, y)u 2
Example: Find the directional derivative of f(x, y) = x 2 y 3 + 2x 4 y at (, 2) in the direction 3 of 2, 2 The partial derivatives are f x (x, y) = 2xy 3 + 8x 3 y f y (x, y) = 3x 2 y 2 + 2x 4 f x (, 2) = 24 f y (, 2) = 4 Then the directional derivative is ( ) ( ) 3 D u f(, 2) = 24 + 4 = 7 3 2 2 2 Example: Find the directional derivative of f(x, y) = x y at (5, ) in the direction of v = 2, 5 The partial derivatives are v 2 v =, 5 f x (x, y) = 2 x y f x (5, ) = 4 f y (x, y) = 2 x y f y (5, ) = 4 Then the directional derivative is D u f(5, ) = 4 ( ) 2 ( ) 5 = 7 4 52 Note: The vector that specifies the direction must be a unit vector Definition: If f is a differentiable function of x and y, then the gradient of f is the vector function f(x, y) = f x (x, y), f y (x, y) Example: Find the gradient of f(x, y) = e xy + sin(x 2 + 2y)
The gradient vector is f(x, y) = ye xy + 2x cos(x 2 + 2y), xe xy + 2 cos(x 2 + 2y) Theorem: (Gradient Formula for the Directional Derivative) If f is a differentiable function of x and y, then D u f(x, y) = f(x, y) u Example: Find the directional derivative of f(x, y) = xe xy v = 2, 3 at ( 3, 0) in the direction of The gradient of f is v 2 v = 3, f(x, y) = e xy + xye xy, x 2 e xy At ( 3, 0), f 0 =, 9 Then the directional derivative is D u f( 3, 0) = f 0 2 + 27 = 29 Note: The directional derivative and gradient can be extended to functions of three variables If f(x, y, z) is differentiable, then f(x, y, z) = f x (x, y, z), f y (x, y, z), f z (x, y, z) and the directional derivative of f at (x 0, y 0, z 0 ) in the direction of the unit vector u is D u f(x 0, y 0, z 0 ) = f(x 0, y 0, z 0 ) u Example: Find the directional derivative of f(x, y, z) = xyz at (2, 4, 2) in the direction of v = 4, 2, 4 v v = 4, 2, 4 = 6 2 3, 3, 2 3
The gradient of f is f(x, y, z) = yz 2 xyz, xz 2 xyz, xy 2 xyz At (2, 4, 2), f 0 =,, Then the directional derivative is 2 D u f(2, 4, 2) = f 0 2 3 + 6 2 3 = 6 Given a function f, in which direction does f change most rapidly? What is the greatest rate of change? Theorem: (Maximal Property of the Gradient) Suppose f is a differentiable function of two or three variables The maximum value of the directional derivative D u f is f and it occurs in the direction of the gradient f Example: Let f(x, y, z) = 3x 2 5xy + xyz Find the rate of change of f at (2, 2, 7) in the direction of v =,, In which direction does f change most rapidly? What is the maximum rate of change at (2, 2, 7)? The gradient of f is v v = 3,, 3 3 f(x, y, z) = 6x 5y + yz, 5x + xz, xy At (2, 2, 7), f 0 = 6, 4, 4 Then the directional derivative is D u f(2, 2, 7) = f 0 6 3 The greatest change occurs in the direction of f 0 = 6, 4, 4 and the greatest change is f 0 = 256 + 6 + 6 = 2 2 Suppose S is a level surface defined by f(x, y, z) That is, f(x, y, z) = k for some constant k If (x 0, y 0, z 0 ) lies on S, then f(x 0, y 0, z 0 ) is a vector that is normal to the tangent plane at (x 0, y 0, z 0 )
Figure 2: Illustration of a level surface f(x, y, z) = k and the gradient vector f(x 0, y 0, z 0 ) Definition: Let S be the level surface defined by f(x, y, z) = k and let (x 0, y 0, z 0 ) lie on S The plane with normal vector f 0 passing through (x 0, y 0, z 0 ) is the tangent plane to the surface S at (x 0, y 0, z 0 ) The line passing through (x 0, y 0, z 0 ) in the direction of f 0 is the normal line to S at (x 0, y 0, z 0 ) Example: Find equations for the tangent plane and normal line to the surface defined by x 2 y + y 2 z + xz 2 = 5 at (2,, ) Let f(x, y, z) = x 2 y + y 2 z + xz 2 The gradient of f is f(x, y, z) = 2xy + z 2, x 2 + 2yz, y 2 + 2xz At (2,, ), f 0 = 5, 2, 3 An equation of the tangent plane is 5(x 2) + 2(y ) 3(z + ) = 0 5x + 2y 3z = 5 The parametric equations for the normal line are x = 2 + 5t y = + 2t z = 3t