Directional Derivatives and Gradients

Directional Derivatives

Directional Derivative

Let z=f(x,y)z = f(x, y) be defined on a neighborhood of P0(x0,y0)P_0(x_0, y_0), and let l=(cosα,cosβ)\vec{l} = (\cos\alpha, \cos\beta) be a unit direction vector. If the limit

limt0+f(x0+tcosα,y0+tcosβ)f(x0,y0)t\lim_{t \to 0^+} \frac{f(x_0 + t\cos\alpha, y_0 + t\cos\beta) - f(x_0, y_0)}{t}

exists, it is called the directional derivative of ff at P0P_0 in the direction l\vec{l}, written flP0\frac{\partial f}{\partial l}\big|_{P_0}.

For u=f(x,y,z)u = f(x, y, z) along l=(cosα,cosβ,cosγ)\vec{l} = (\cos\alpha, \cos\beta, \cos\gamma):

fl=limt0+f(x0+tcosα,y0+tcosβ,z0+tcosγ)f(x0,y0,z0)t\frac{\partial f}{\partial l} = \lim_{t \to 0^+} \frac{f(x_0 + t\cos\alpha, y_0 + t\cos\beta, z_0 + t\cos\gamma) - f(x_0, y_0, z_0)}{t}

Computation Formula

定理1

If z=f(x,y)z = f(x, y) is differentiable at P0P_0, then the directional derivative in every direction l=(cosα,cosβ)\vec{l} = (\cos\alpha, \cos\beta) exists, and

fl=fx(x0,y0)cosα+fy(x0,y0)cosβ\frac{\partial f}{\partial l} = f_x(x_0, y_0)\cos\alpha + f_y(x_0, y_0)\cos\beta

For three variables: fl=fxcosα+fycosβ+fzcosγ\frac{\partial f}{\partial l} = f_x\cos\alpha + f_y\cos\beta + f_z\cos\gamma.

Relation to Partial Derivatives

Along the positive xx-axis, fl=fx\frac{\partial f}{\partial l} = f_x; along the positive yy-axis, fl=fy\frac{\partial f}{\partial l} = f_y. Along the negative directions, the directional derivative is the negative of the corresponding partial derivative.

Gradient

Gradient

Let z=f(x,y)z = f(x, y) have first partial derivatives at (x,y)(x, y). The vector

f(x,y)=(fx,fy)=fxi+fyj\nabla f(x, y) = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right) = f_x \vec{i} + f_y \vec{j}

is called the gradient of ff at (x,y)(x, y), written f\nabla f or gradf\text{grad}\, f.

Here =(x,y)\nabla = \left( \frac{\partial}{\partial x}, \frac{\partial}{\partial y} \right) is the Nabla (Hamilton) operator.

For u=f(x,y,z)u = f(x, y, z):

f=(fx,fy,fz)\nabla f = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z} \right)

The magnitude of the gradient is

f=fx2+fy2(two variables),f=fx2+fy2+fz2(three variables)|\nabla f| = \sqrt{f_x^2 + f_y^2} \quad \text{(two variables)}, \qquad |\nabla f| = \sqrt{f_x^2 + f_y^2 + f_z^2} \quad \text{(three variables)}

Gradient and Directional Derivative

定理2

If ff is differentiable at PP and l\vec{l} is any unit direction vector, then

fl=fl=fcosθ\frac{\partial f}{\partial l} = \nabla f \cdot \vec{l} = |\nabla f| \cos\theta

where θ\theta is the angle between the gradient f\nabla f and the direction l\vec{l}.

Geometric Applications: Tangent Plane and Normal Line

Tangent Plane to a Surface z=f(x,y)z = f(x, y)

Tangent plane

The tangent plane to the surface z=f(x,y)z = f(x, y) at (x0,y0,z0)(x_0, y_0, z_0) is

zz0=fx(x0,y0)(xx0)+fy(x0,y0)(yy0)z - z_0 = f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0)

and the normal line is

xx0fx(x0,y0)=yy0fy(x0,y0)=zz01\frac{x - x_0}{f_x(x_0, y_0)} = \frac{y - y_0}{f_y(x_0, y_0)} = \frac{z - z_0}{-1}

Tangent Plane to a Level Surface F(x,y,z)=0F(x,y,z)=0

Tangent plane to a level surface

At (x0,y0,z0)(x_0,y_0,z_0) with F0\nabla F \neq 0, the tangent plane is

Fx(x0,y0,z0)(xx0)+Fy(x0,y0,z0)(yy0)+Fz(x0,y0,z0)(zz0)=0F_x(x_0,y_0,z_0)(x-x_0) + F_y(x_0,y_0,z_0)(y-y_0) + F_z(x_0,y_0,z_0)(z-z_0) = 0

and the normal line has direction F(x0,y0,z0)\nabla F(x_0,y_0,z_0).

Worked Examples

Example 1: Directional Derivative

Find the directional derivative of z=x2+y2z = x^2 + y^2 at (1,2)(1, 2) in the direction l=(1,1)\vec{l} = (1, 1).

Answer and Explanation(2 个标签)
directional derivativeunit vector

Detailed steps:

  1. Normalize: l0=(12,12)\vec{l}^0 = (\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}})
  2. fx=2x,fy=2yf_x = 2x, f_y = 2y; at (1,2)(1,2), fx=2,fy=4f_x=2, f_y=4
  3. fl=212+412=32\frac{\partial f}{\partial l} = 2\cdot\frac{1}{\sqrt{2}} + 4\cdot\frac{1}{\sqrt{2}} = 3\sqrt{2}

Answer: 323\sqrt{2}.

Example 2: Three-Variable Directional Derivative

Find the directional derivative of u=xyzu = xyz at (1,1,1)(1,1,1) in the direction l=(2,1,2)\vec{l} = (2,-1,2).

Answer and Explanation(2 个标签)
directional derivativethree variables

Detailed steps:

  1. Normalize: l=3|\vec{l}|=3, so l0=(23,13,23)\vec{l}^0 = (\frac{2}{3}, -\frac{1}{3}, \frac{2}{3})
  2. ux=yz,uy=xz,uz=xyu_x=yz, u_y=xz, u_z=xy; each equals 1 at (1,1,1)(1,1,1)
  3. ul=2313+23=1\frac{\partial u}{\partial l} = \frac{2}{3} - \frac{1}{3} + \frac{2}{3} = 1

Answer: 11.

Example 3: Gradient and Steepest Ascent

Find the direction and magnitude of steepest ascent of f(x,y)=x2+y2f(x, y) = x^2 + y^2 at (1,1)(1, 1).

Answer and Explanation(2 个标签)
gradientsteepest ascent

Detailed steps:

  1. f=(2x,2y)\nabla f = (2x, 2y), so f(1,1)=(2,2)\nabla f(1,1) = (2, 2)
  2. The direction of steepest increase is (1,1)(1,1) (normalized (12,12)(\frac{1}{\sqrt2},\frac{1}{\sqrt2}))
  3. The maximum rate of increase is f(1,1)=4+4=22|\nabla f(1,1)| = \sqrt{4+4} = 2\sqrt{2}

Answer: direction (1,1)(1,1), maximum rate 222\sqrt{2}.


Summary

Symbols Used in This Article

SymbolTypeReading/ExplanationMeaning in This Article
l\vec{l}vectorlThe direction vector
cosα,cosβ\cos\alpha, \cos\betanumberscosine alpha, cosine betaDirection cosines of l\vec{l}
fl\frac{\partial f}{\partial l}directional derivativepartial f partial lThe rate of change in direction l\vec{l}
f\nabla fvectornabla fThe gradient of ff
θ\thetaGreek letterthetaThe angle between f\nabla f and l\vec{l}

English–Chinese Glossary

English termChinese termPhoneticExplanation
directional derivative方向导数/dɪˌrekʃənl dɪˈrɪvətɪv/Rate of change in a specified direction
gradient梯度/ˈɡreɪdiənt/The vector of all first partial derivatives
Nabla operator哈密顿算子/ˈnɑːblə ˈɒpəreɪtə/The vector differential operator \nabla
steepest ascent最速上升/ˈstiːpɪst əˈsent/The direction of fastest increase
tangent plane切平面/ˈtændʒənt pleɪn/The plane best approximating a surface at a point
normal line法线/ˈnɔːml laɪn/The line perpendicular to a surface/tangent plane
level surface等值面/ˈlɛvəl ˈsɜːrfɪs/A surface of constant function value