Chapter 4 Directional Derivative and the Gradient Operator The equation z = f(x, y) defines a surface in 3 dimensions. We can write this as z f(x, y) = 0, or g(x, y, z) = 0, where g(x, y, z) = z f(x, y). The general equation of a surface is g(x, y, z) = c, (4.1) where c is a parameter. Each value of c labels one member of the family of surfaces. g has a magnitude but no direction. Thus, g is a scalar function of x, y and z. Example 4.1 Consider g(x, y, z) = x 2 + y 2 + z 2 = a 2, where c = a 2. This describes the family of concentric spheres centred at the origin and with radius a. An example is shown in Figure 4.1. Consider two surfaces (S 1 and S 2 ) on which g is equal to c 1 and c 2 respectively. This is illustrated in Figure 4.2. Suppose the point lies on surface S 1 and Q on S 2. At, g = c 1 and at Q g = c 2. Thus, the value of g changes from c 1 to c 2 as we move along the path Q. For general and Q, we can calculate the rate of change of g along the line Q. This means we calculate the directional derivative. Suppose the path is the straight line joining and Q. The unit vector û is parallel to Q and has cartesian components û = (l, m, n) li + mj + nk, 57
58CHATER 4. DIRECTIONAL DERIVATIVE AND THE GRADIENT OERATOR Figure 4.1: The sphere x 2 + y 2 + z 2 = 1. and i, j, k are the unit vectors along the x, y and z axes. As û is a unit vector û = 1. This means that û 2 = û û = l 2 + m 2 + n 2 = 1. This result follows directly from the scalar (or dot) product of vectors. then A = (A x, A y, A z ) = A x i + A y j + A z k, B = (B x, B y, B z ) = B x i + B y j + B z k, A B = A x B x + A y B y + A z B z. Define the coordinates of as (x 0, y 0, z 0 ) and Q as (x, y, z). If Q is a distance s from in the direction of û, the coordinates of Q are or OQ = O + sû, x = x 0 + ls, y = y 0 + ms, z = z 0 ns. (4.2) As s is varied ( < s < + ) then any point of the line may be reached. This is called the parametric equation for the line. The coordinates of Q may be written as (x(s), y(s), z(s)). Note that the vector Q is Q = sû.
59 Figure 4.2: Two surfaces labelled by the constants c 1 and c 2. The path between the points and Q is indicated. Since û is a unit vector, s represents the distance from to Q. The variation of g along the line is g(x, y, z) = g(x(s), y(s), z(s)), on using (4.2). Using the Chain Rule ( ) ( dg g = ds x dx ds + g y dy ds + g z dz ) ds Here the subscript is used to indicate that the derivatives are evaluated at the point. Using (4.2), this may be rearranged to give ( ) ( dg g = ds x l + g y m + g ) z n. Note that the right hand side is equivalent to the scalar product of the two vectors ( g x i + g y j + g ) z k (li + mj + nk).
60CHATER 4. DIRECTIONAL DERIVATIVE AND THE GRADIENT OERATOR Thus, ( ) ( dg g = ds x i + g y j + g ) z k û, (4.3) which is called the directional derivative of g along the direction û at the point. The vector g x i + g y j + g k g, (4.4) z is so important in mathematics that it is given the special name of the gradient of the scalar function g(x, y, z). It is denoted by g, and is also called either grad g or the gradient of g. Note that is a vector operator. It converts a scalar function into a vector function. We can think of as the vector operator = i x + j y + k z The symbol is called grad, del or nabla. Thus, the directional derivative of g(x, y, z) along û at (x 0, y 0, z 0 ) is dg ds = ( g û) x 0,y 0,z 0. Note that both terms on the right hand side are vectors and we take the scalar product of two vectors to produce the directional derivative. Example 4.2 Find the directional derivative of g = xy 2 z 3, in the direction u = 2i + 6j + 3k at the point = (1, 1, 1). First we need g = i g x + j g y + k g z = i(y2 z 3 ) + j(2xz 3 ) + k(3xy 2 z 2 ). Note that g is a vector. At (1, 1, 1), we have ( g) = i + 2j + 3k. Next we need to calculate the unit vector so that û u (2i + 6j + 3k) = = 2 u 4 + 36 + 9 7 i + 6 7 j + 3 7 k.
4.1. NORMALS TO SURFACES AND TANGENT LANES 61 Thus, the directional derivative we require is dg ds = ( g) û = 1 (i + 2j + 3k) (2i + 6j + 3k). 7 Evaluating the scalar product gives the final answer as dg ds = 1 7 (2 + 12 + 9) = 23 7. Note that the rates of change of g(x, y, z) along the x, y and z axes are just g/ x, g/ y and g/ z, from before. To confirm that the directional derivative gives this result, we set û = i. Thus, ( g g i = x i + g y j + g ) z k i = g x. Similarly û = j gives g/ y and û = k gives g/ z. 4.1 Normals to surfaces and tangent planes Given a surface f(x, y, z) = c, and a point on it, the tangent plane (T ) to the surface at is the plane which just touches the surface at. The normal vector, (n), to the surface at is defined as the vector which is orthogonal (perpendicular) to every vector t in T through. This is illustrated in Figure 4.3. Note 1: Since f(x, y, z) is constant on the surface, the directional derivative, evaluated at, along any t will be zero. Thus, ( ) df = ( f) ds t = 0, for any t. (4.5) Thus, ( f) is normal to both the surface (at ) and the tangent plane T. ( f) is parallel to the normal at called n. Example 4.3 Let f(x, y, z) = x y 2 +xz. The surface f = 1 contains the point = (1, 2, 2), (check to see that f(1, 2, 2) = 1). Find a vector parallel to n at. and so, evaluating this at (1, 2, 2) gives f = i(1 + z) + j( 2y) + k(x), ( f) = 3i 4j + k, and is parallel to n at. Note 2: Consider the rate of change of f(x, y, z) at along different directions defined by û. At,
62CHATER 4. DIRECTIONAL DERIVATIVE AND THE GRADIENT OERATOR Figure 4.3: The surface f(x, y, z) = c is shown. The tangent plane is labelled by T and a typical vector t lying in the tangent plane passing through is shown. ( ) df = ( f) û = f cos γ, ds û (from A B = AB cos θ). When γ = π/2 we find that (df/ds) γ=π/2 = 0. This is to be expected since û coincides with some t in the tangent plane. Thus, û is in the tangent plane and f is constant at, see (4.5). Evidently, (df/ds) has its maximum value when cos γ = 1, namely when γ = 0. Hence, û coincides with the normal direction (n or f). In this case, df ds = f. Note 3: The equation of the plane T, through 0. If (x, y, z) is in T, then the vector (r r 0 ) must be perpendicular to n. Thus, (r r 0 ) n 0 = 0.
4.1. NORMALS TO SURFACES AND TANGENT LANES 63 Figure 4.4: The direction of the normal to the surface, n = f makes an angle γ to the direction defined by u. Therefore, if r = xi + yj + zk and r 0 = x 0 i + y 0 j + z 0 k, then using the definition of f and expanding the scalar product gives the equation of the plane as ( ) ( ) ( ) f f f (x x 0 ) + (y y 0 ) + (z z 0 ) = 0. x 0 y 0 z 0 This is of the form ax + by + cz = d, and is the equation of the plane T. Example 4.4 Find the tangent plane to xy 2 + x 2 z = 7, at the point (1, 2, 3). Thus, f = xy 2 + x 2 z and f = 7. The normal vector is n and may be taken as ( f) (1,2,3). Thus, f = i(y 2 + 2xz) + j(2xy) + k(x 2 ),
64CHATER 4. DIRECTIONAL DERIVATIVE AND THE GRADIENT OERATOR at the point (1, 2, 3) we have n = f = 10i + 4j + k. With r 0 = (1, 2, 3), so (r r 0 ) n = 0 gives (x 1) 10 + (y 2) 4 + (z 3) 1 = 0, 10x + 4y + z = 21.