Skip to main content

Section 7.3 The Gradient Vector

Note that we can write the equation of the line through the point \(P_0(x_0,y_0)\) with the direction \(\mathbf u = u_1\mathbf i + u_2\mathbf j\) as
\begin{equation} x(s) = x_0 + su_1, \qquad y(s) = y_0 + su_2.\tag{7.3} \end{equation}
We can use the above relation between \(x\text{,}\) \(y\text{,}\) and \(s\) and the chain rule, whose dependency diagram is shown in FigureΒ 7.9, to compute the directional derivative as follows:
\begin{align*} \left(D_{\mathbf u} f\right)_{P_0} = \left(\frac{df}{ds}\right)_{\mathbf u,P_0} \amp= \left(\frac{\partial f}{\partial x}\right)_{P_0}\frac{dx}{ds}\\ \amp\quad + \left(\frac{\partial f}{\partial y}\right)_{P_0}\frac{dy}{ds}\\ \amp= \left(\frac{\partial f}{\partial x}\right)_{P_0}\cdot u_1\\ \amp\quad + \left(\frac{\partial f}{\partial y}\right)_{P_0}\cdot u_2\\ \amp= \left[\left(\frac{\partial f}{\partial x}\right)_{P_0}\mathbf i + \left(\frac{\partial f}{\partial y}\right)_{P_0}\mathbf j\right] \cdot \left(u_1\mathbf i + u_2\mathbf j\right). \end{align*}
The vector in the first set of parentheses is known as the gradient vector.

Definition 7.8. Gradient Vector.

The gradient vector of the function \(f(x,y)\) at \(P_0(x_0,y_0)\) is the vector
\begin{equation} \left(\nabla f\right)_{P_0} = \left(\frac{\partial f}{\partial x}\right)_{P_0}\mathbf i + \left(\frac{\partial f}{\partial y}\right)_{P_0}\mathbf j.\tag{7.4} \end{equation}
The gradient vector and the directional derivative of \(f(x,y)\) at \(P_0(x_0,y_0)\) in the direction \(\mathbf u = u_1\mathbf i + u_2\mathbf j\) are related via the following dot product:
\begin{equation} \left(\frac{df}{ds}\right)_{\mathbf u,\,P_0} = \left(\nabla f\right)_{P_0}\cdot\mathbf u.\tag{7.5} \end{equation}
Diagram Exploration Keyboard Controls
Key Action
Enter, A Activate keyboard driven exploration
B Activate menu driven exploration
Escape Leave exploration mode
Cursor down Explore next lower level
Cursor up Explore next upper level
Cursor right Explore next element on level
Cursor left Explore previous element on level
X Toggle expert mode
W Extra details if available
Space Repeat speech
M Activate step magnification
Comma Activate direct magnification
N Deactivate magnification
Z Toggle subtitles
C Cycle contrast settings
T Monochrome colours
L Toggle language (if available)
K Kill current sound
Y Stop sound output
O Start and stop sonification
P Repeat sonification output
Figure 7.9. The chain rule dependency diagram: multiplying down each branch and adding the two products gives \(\frac{df}{ds} = \frac{\partial f}{\partial x}\frac{dx}{ds} + \frac{\partial f}{\partial y}\frac{dy}{ds}\text{.}\)
A fundamental geometric property of the gradient is that, at every point, it is perpendicular to the level curve of \(f\) passing through that point, as the interactive figure below lets you verify. We state and prove this fact now.

Proof.

Suppose the level curve \(C\) is parametrized by a differentiable vector function
\begin{equation} \mathbf r(t) = \langle x(t),\, y(t)\rangle,\tag{7.6} \end{equation}
and let \(\mathbf v(t) = \langle x'(t),\, y'(t)\rangle\) denote its velocity vector. Because every point of \(C\) lies on the level curve, its coordinates satisfy
\begin{equation} f\bigl(x(t),\, y(t)\bigr) = c \qquad \text{for all } t.\tag{7.7} \end{equation}
The left-hand side is constant in \(t\text{,}\) so its derivative is zero. Differentiating both sides with respect to \(t\) and applying the chain rule gives
\begin{align} \frac{d}{dt}\, f\bigl(x(t), y(t)\bigr) \amp= \frac{\partial f}{\partial x}\,\frac{dx}{dt} + \frac{\partial f}{\partial y}\,\frac{dy}{dt}\notag\\ \amp= 0.\tag{7.8} \end{align}
We recognize the middle expression as the dot product of the gradient vector with the velocity vector:
\begin{align} \left\langle \frac{\partial f}{\partial x},\, \frac{\partial f}{\partial y} \right\rangle \cdot \left\langle \frac{dx}{dt},\, \frac{dy}{dt} \right\rangle \amp= \nabla f \cdot \mathbf v(t)\notag\\ \amp= 0.\tag{7.9} \end{align}
Therefore, at each point of \(C\text{,}\) the gradient \(\nabla f\) is orthogonal to the velocity vector \(\mathbf v(t)\text{,}\) as shown in FigureΒ 7.11. Since the velocity vector points in the direction of motion along the curve, it is tangent to \(C\text{;}\) hence \(\nabla f\) being orthogonal to \(\mathbf v(t)\) means precisely that \(\nabla f\) is perpendicular to the level curve \(C\text{.}\) This holds at every point where \(\nabla f \neq \mathbf 0\text{.}\)
Diagram Exploration Keyboard Controls
Key Action
Enter, A Activate keyboard driven exploration
B Activate menu driven exploration
Escape Leave exploration mode
Cursor down Explore next lower level
Cursor up Explore next upper level
Cursor right Explore next element on level
Cursor left Explore previous element on level
X Toggle expert mode
W Extra details if available
Space Repeat speech
M Activate step magnification
Comma Activate direct magnification
N Deactivate magnification
Z Toggle subtitles
C Cycle contrast settings
T Monochrome colours
L Toggle language (if available)
K Kill current sound
Y Stop sound output
O Start and stop sonification
P Repeat sonification output
Figure 7.11. The gradient \(\nabla f\) meets the level curve \(C\colon f = c\) at a right angle: it is perpendicular to the velocity vector \(\mathbf v(t)\text{,}\) which is tangent to \(C\text{.}\)

Activity 7.3.1. Checking that the Gradient Meets Level Curves at Right Angles.

TheoremΒ 7.10 claims that \(\nabla f\) is perpendicular to the level curve through a point. This activity asks you to verify that claim by hand at one point, and then to test it at many points using the interactive figure that follows.

(a)

Let \(f(x,y) = 1 + x^2 + y^2\text{.}\) Find the level curve of \(f\) through \(P_0(1,1)\text{,}\) and give a vector tangent to that curve at \(P_0\text{.}\)
Hint.
Level curves of this \(f\) are circles centred at the origin. A tangent to a circle is perpendicular to its radius.
Answer.
Since \(f(1,1) = 3\text{,}\) the level curve is \(1 + x^2 + y^2 = 3\text{,}\) that is the circle \(x^2 + y^2 = 2\) of radius \(\sqrt 2\text{.}\) The radius at \(P_0\) points along \(\mathbf i + \mathbf j\text{,}\) so a tangent vector is \(\mathbf T = -\mathbf i + \mathbf j\text{.}\)

(b)

Compute \(\left(\nabla f\right)_{(1,1)}\) and then the dot product of that gradient with your tangent vector. What does the result say?
Answer.
\(\nabla f = 2x\,\mathbf i + 2y\,\mathbf j\) gives \(\left(\nabla f\right)_{(1,1)} = 2\,\mathbf i + 2\,\mathbf j\text{,}\) and
\begin{align*} \left(\nabla f\right)_{(1,1)} \cdot \mathbf T \amp= (2)(-1) + (2)(1) = 0 . \end{align*}
A zero dot product between non-zero vectors means the two are orthogonal, so \(\nabla f\) meets the level curve at a right angle at \(P_0\text{,}\) exactly as TheoremΒ 7.10 asserts.

(c)

Repeat the argument at an arbitrary point \((a,b) \ne (0,0)\) to show the right angle is not a coincidence of the point \((1,1)\text{.}\)
Answer.
The level curve through \((a,b)\) is the circle \(x^2 + y^2 = a^2 + b^2\text{,}\) whose tangent there is \(\mathbf T = -b\,\mathbf i + a\,\mathbf j\text{.}\) Since \(\left(\nabla f\right)_{(a,b)} = 2a\,\mathbf i + 2b\,\mathbf j\text{,}\)
\begin{align*} \left(\nabla f\right)_{(a,b)} \cdot \mathbf T \amp= 2a(-b) + 2b(a) = 0 , \end{align*}
so the gradient is perpendicular to the level curve at every point other than the origin, where \(\nabla f = \mathbf 0\) and no direction is singled out.

(d)

Now drag the red point in FigureΒ 7.12 to several locations, including points on the axes and points far from the origin. Confirm that the gradient arrow always meets the level curve at a right angle, and describe how the length of the arrow changes as the point moves away from the origin. Can you place the point where the gradient vanishes?
Instructions.
Drag the red point anywhere in the plane. The gradient vector \(\nabla f = 2x\,\mathbf i + 2y\,\mathbf j\) of \(f(x,y) = 1 + x^2 + y^2\) is drawn at the point, together with the level curve of \(f\) through the point. Observe that the gradient is always perpendicular to the level curve and points in the direction in which \(f\) increases.
Figure 7.12. The gradient \(\nabla f\) of \(f(x,y)=1+x^2+y^2\) at a movable point, shown with the level curve through that point, illustrating that \(\nabla f\) is perpendicular to the level curves.
Answer.
The right angle persists everywhere. The arrow lengthens as the point moves outward, since \(|\nabla f| = 2\sqrt{x^2 + y^2}\) grows with the distance from the origin; correspondingly the level curves are spaced more closely there, because \(f\) is climbing faster. At the origin \(\nabla f = \mathbf 0\text{:}\) the level curve degenerates to a single point and there is no direction of steepest ascent.
You have attempted of activities on this page.