Skip to main content

Section 4.6 Directional Derivatives and the Gradient

References.

Introduction.

It is natural to ask about the rate of change of a function \(f(x,y)\) as the arguments change in any direction around a point \((x_0,y_0)\) not just along the coordinate axes, and to ask questions like in which direction is change the fastest.
The cautionary Example 4.4.5 of the "uncomfortable saddle" in Section 4.4 shows that the partial derivatives do not always answer this question.
On the other hand, when a function is differentiableat the point, it is well approximated by the tangent plane there, and then this linear approximation becomes a good candidate for giving information about the rate of change in any direction, from the partial derivatives alone.

Topics.

Subsection 4.6.1 Directional Derivatives

A direction of change in the plane can be specified by a unit vector \(\vec{u} = \vector{u_1,u_2}\text{,}\) and we can consider how \(f(x,y)\) changes in this direction near \((x_0,y_0)\) looking at a "slice" of the function, along the line \(\vector{x_0,y_0}+t\vec{u}\text{.}\) The value of the function along this line is \(f(x_0+t u_1,y_0+t u_2)\) and its rate of change is given by the Chain Rule as
\begin{equation*} \frac{df}{dt} = \frac{\partial f}{\partial x}\frac{d x}{d t} + \frac{\partial f}{\partial y}\frac{d y}{d t} = f_x(x_0,y_0)u_1 + f_y(x_0,y_0)u_2 \end{equation*}
This is the directional derivative of \(f\) at \((x_0,y_0)\), denoted \(D_{\vec{u}}f(x_0,y_0)\text{,}\) and it does indeed depend only on the partial derivatives at the point.
Note that its value is the same as if one used the linear approximation \(T\) at that point in place of \(f\text{.}\)

Directional Derivatives Defined With Limits.

Equivalently, the directional derivative can be defined in terms of limits as
\begin{equation*} D_{\vec{u}}f(x_0,y_0) = \lim_{h \to 0}\frac{f(x_0+hu_1,y_0+hu_2)-f(x_0,y_0)}{h} \end{equation*}
This exists when \(f\) is differentiable at the point \((x_0,y_0)\text{.}\)
To summarize, for any unit vector \(\vec{u} = \vector{u_1,u_2}\) (or indeed any non-zero vector) and any function \(f\) differentiable at \((x_0,y_0)\text{,}\) the directional derivative of \(f\) at \((x_0,y_0)\) in direction \(\vec{u}\) is
\begin{equation*} D_{\vec{u}}f(x_0,y_0) = f_x(x_0,y_0)u_1 + f_y(x_0,y_0)u_2 = \vector{ f_x(x_0,y_0),f_y(x_0,y_0)} \cdot \vec{u} \end{equation*}

Subsection 4.6.2 The Gradient Vector

The vector \(\vector{f_x(x_0,y_0),f_y(x_0,y_0)}\) appearing in the formula for the directional derivative encapsulates all information about directional and partial derivatives of \(f\) at \((x_0,y_0)\) in a way that has a nice geometrical meaning.
It is called the gradient vector of \(f\) at \((x_0,y_0)\), and denoted \(\Grad f\) or \(\del f\text{,}\) the latter sometimes pronounced “del f”. (Sometimes, the overarrow is omitted, writing just \(\nabla f\text{;}\) this upside down \(\Delta\) is called a nabla.)
Considered as a function of position,
\begin{equation*} \del f(x,y) = \vector{ f_x(x,y),f_y(x,y)} = \frac{\partial f}{\partial x}\veci+\frac{\partial f}{\partial y}\vecj. \end{equation*}
Note: this is our first example of a vector valued function of several variables.

Directional Derivatives in Terms of The Gradient Vector.

The directional derivative above can be written as
\begin{equation*} D_{\vec{u}}f(x,y) = \vec{u} \cdot \del f(x,y), \end{equation*}
so the gradient contains all information about directional derivatives.

Subsection 4.6.3 Tangent Lines to Level Curves

If \(\ds\frac{\partial F}{\partial y} \neq 0\) at point \((x_0,y_0)\text{,}\) the implicit function theorem says that the level curve \(C\) of \(F(x,y)\) for value \(k=F(x_0,y_0)\) is described nearby by a function \(y=f(x)\text{.}\)
Then Chain Rule differentiation of \(k=F(x,f(x))\) gives
\begin{equation*} 0 = \frac{\partial F}{\partial x} \frac{dx}{dx} + \frac{\partial F}{\partial y} \frac{dy}{dx} = \frac{\partial F}{\partial x} + \frac{\partial F}{\partial y} \frac{dy}{dx} \end{equation*}
so
\begin{equation*} \frac{dy}{dx} = - \frac{{\partial F}/{\partial x}}{{\partial F}/{\partial y}} \end{equation*}
Thus the tangent line to the level curve through this point has this slope, and \(\vector{-\frac{\partial F}{\partial y}(x_0,y_0),\frac{\partial F}{\partial x}(x_0,y_0)}\) is a tangent vector to the curve. This is perpendicular to the gradient vector \(\vector{\frac{\partial F}{\partial x}(x_0,y_0),\frac{\partial F}{\partial y}(x_0,y_0)}\text{,}\) so the gradient at such a point on the curve is normal to the tangent line to the level curve at that point, and can be considered normal to the level curve \(C\text{.}\)
Similarly, if \({\partial F}/{\partial x} \neq 0\) at any point, swapping \(x\) and \(y\) above shows that part of the described by an implicit function \(x=g(y)\text{,}\) and again the gradient vector is normal to the level curve. Hence,

Subsection 4.6.4 Maximizing the Directional Derivative

The gradient gives the direction in which the directional derivative is greatest, and is thus the direction of most rapid increase of the value of the function.
One physical interpretation is that if the function value is altitude, the gradient vector indicates the direction "straight up-hill". To see this, recall that if the angle between \(\del F\) at \((x_0,y_0)\) and a unit vector \(\vec{u}\) is \(\theta\text{,}\)
\begin{equation*} D_{\vec{u}}F(x_0,y_0) = \del F \cdot \vec{u} = |\del F| |\vec{u}| \cos\theta, \end{equation*}
and this has maximum value when \(\cos \theta = 1\text{,}\) which is when \(\theta=0\text{,}\) so \(\vec{u}\) is a positive multiple of \(\del F\text{.}\) Thus \(\vec{u} = {\del F}/{|\del F|}\) gives the direction in which \(D_{\vec{u}}F\) is greatest and so \(F\) is increasing the fastest. Further, the maximum value of the directional derivative is then \(|\del F|\text{,}\) because \(|\vec{u}|=1.\)

Aside: the Directions of Fastest Decrease and of No Change.

The opposite direction \(-\del F\) gives fastest decrease of \(F\text{.}\)
In between, moving perpendicular to \(\del F\) is moving tangent to the level curve, which is what happens at that point if movement is along the level curve. Thus moving perpendicular to the direction of fastest increase or decrease in \(F\) is moving in the "direction of no change in \(F\)", given by moving along a level curve.

Subsection 4.6.5 The Implicit Function Theorem in Terms of The Gradient

Proof sketch.

At least one of the components \(F_x(x_0,y_0)\) and \(F_y(x_0,y_0)\) of the gradient is non-zero, so at least one option in Theorem 4.5.5 in Section 4.5 applies, and the parameter \(t\) can always be chosen to be one of \(x\) or \(y\text{.}\) Then either \(dx/dt = 1\) or \(dy/dt = 1\text{,}\) so the velocity is non-zero, ensuring smoothness.

Exercise 4.6.3.

Sketch the level sets \(F(x,y) = x^2 - y^2 = k\text{.}\) Break it up into the three cases
  1. \(\displaystyle k \gt 0\)
  2. \(\displaystyle k \lt 0\)
  3. and the exceptional case \(k = 0\)

Subsection 4.6.6 Functions of Three Variables

For a differentiable function \(f\) of three variables one can likewise define the directional derivative of in direction \(\vec{u}=\vector{u_1,u_2,u_3}\)
\begin{equation*} D_{\vec{u}}f(x,y,z) = \lim_{h \to 0}\frac{f(x+u_1h,y+u_2h,z+u_3h)-f(x,y,z)}{h} \end{equation*}
and the gradient
\begin{equation*} \del f(x,y,z) = \vector{f_x(x,y,z),f_y(x,y,z),f_z(x,y,z)}. \end{equation*}
Again
\begin{equation*} D_{\vec{u}}f(x,y,z) = \vec{u} \cdot \del f(x,y,z), \end{equation*}
and again the directional derivative is greatest in the direction of the gradient.

Tangent Planes to Level Surfaces.

For a function \(F\text{,}\) consider the level surface \(S\) given by \(F(x,y,z)=k\) through a point \(P(x_0,y_0,z_0)\text{,}\) consider and any curve \(\vec{r}(t) = \vector{x(t),y(t),z(t)}\) that lies in this level surface and passes through this point when \(t=t_0\text{.}\) The composition of \(F\) with these three component functions give the constant function \(F(x(t),y(t),z(t))=k\text{,}\) and by the Chain Rule, its zero derivative is also
\begin{equation*} 0 = \frac{\partial F}{\partial x}\frac{dx}{dt} + \frac{\partial F}{\partial y}\frac{dy}{dt} + \frac{\partial F}{\partial z}\frac{dz}{dt} = \del F \cdot \vec{r}'(t) \end{equation*}
In particular \(\del F(x_0,y_0,z_0) \cdot \vec{r}'(t_0) = 0\text{.}\)
The possible directions \(\vec{r}'(t_0)\) for a curve passing through this point and staying in the level curve are thus all orthogonal to \(\del F(x_0,y_0,z_0)\) and thus are directions in the plane:
\begin{align*} \del \amp F(x_0,y_0,z_0) \cdot \vector{x-x_0,y-y_0,z-z_0}\\ \amp= F_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 \end{align*}
Thus it is natural to call this plane the tangent plane to this level surface \(S\) at point \(P\) and to say that the direction of \(\del F(x_0,y_0,z_0)\) is normal to \(S\) at \(P\text{.}\)

Normal Lines to Level Surfaces.

The line through this point normal to the surface is called the normal line to \(S\) through \(P\), and has symmetric equations
\begin{equation*} \frac{x-x_0}{F_x(x_0,y_0,z_0)} = \frac{y-y_0}{F_y(x_0,y_0,z_0)} =\frac{z-z_0}{F_z(x_0,y_0,z_0)}. \end{equation*}

Tangent Planes to Graphs.

An important special case is the tangent plane to the graph of a function of two variables, \(z=f(x,y)\text{.}\) This is given as a level surface by \(F(x,y,z)=f(x,y)-z=0\text{,}\) so \(F_z(x,y,z)=-1\text{,}\) leading to the equation
\begin{equation*} f_x(x_0,y_0)(x-x_0)+f_x(x_0,y_0)(y-y_0) - (z-z_0)=0. \end{equation*}
Using \(z_0=f(x_0,y_0)\text{,}\) this is
\begin{equation*} z=f(x_0,y_0)+f_x(x_0,y_0)(x-x_0)+f_x(x_0,y_0)(y-y_0), \end{equation*}
which is the equation of the tangent plane to \(z=f(x,y)\) at \((x_0,y_0)\) seen in Section 4.4.

Study Guide.

Study Section 4.6 of Calculus Volume 3
 9 
openstax.org/books/calculus-volume-3/pages/4-6-directional-derivatives-and-the-gradient
; in particular
  • All Theorems, Examples and Checkpoints.
  • One or several exercises from each of the following ranges or groups: 263–273, 274–279, 280–283, 299–301, 302–305.