4.2 Gradients

Gradient Fields

Recall that if \(f\) is a scalar function of two variables, then its gradient \(\nabla f\) (or \(\grad f\)) is defined by \[\nabla f(x,y) = f_x(x,y)\textbf {i} + f_y(x,y) \textbf {j}\]

Therefore \(\nabla f\) is a vector field on \(\mathbb {R}^2\). Similarly for \(f\) a function of 3 variables \((x,y,z)\) \[\nabla f(x,y,z) = f_x(x,y,z)\textbf {i} + f_y(x,y,z)\textbf {j} + f_z(x,y,z)\textbf {k}\]

Example 4.2.1. Find the gradient vector field of \[f(x,y) = x^2 + y^2 .\] Plot the gradient vector field together with a contour map of \(f\), and say how the two are related.

Solution. \[\nabla f(x,y) = f_x\textbf {i} + f_y \textbf {j} = 2x\textbf {i} + 2y\textbf {j} = 2\big (x\textbf {i} + y\textbf {j}\big ).\] At every point the gradient therefore points directly away from the origin, and its length \(2\sqrt {x^2+y^2}\) grows with the distance from it. For instance \[\nabla f(1,0) = 2\textbf {i},\qquad \nabla f(-1,0)= -2\textbf {i},\qquad \nabla f(0,1) = 2\textbf {j},\qquad \nabla f(0,-1) = -2\textbf {j}.\] The level curves \(f(x,y) = k\) are the circles \(x^2+y^2 = k\), centred at the origin.

xyf = k

The arrows cross every circle at right angles, and they lengthen as the circles grow further apart in value. Both observations are general: the gradient is always perpendicular to the level curve through a point, because moving along a level curve does not change \(f\) and so the directional derivative in that direction is zero; and the gradient is longest where the level curves are most crowded, because that is where \(f\) changes fastest.

Conservative Vector Fields

A vector field \(F\) is called a conservative vector field if it is the gradient of some scalar function, that is, if there exists a function \(f\) with \(F = \nabla f\). The function \(f\) is then called a potential for \(F\).

Theorem 4.2.2. A vector field \(F = P\textbf {i} + Q \textbf {j} + R \textbf {k}\) with continuous first partial derivatives is the gradient of a function \(f\) if and only if \[\frac {\partial P}{\partial y} = \frac {\partial Q}{\partial x}\hspace {0.5cm}, \hspace {0.5cm} \frac {\partial R}{\partial x} = \frac {\partial P}{\partial z}\hspace {0.5cm} \text {and}\hspace {0.5cm} \frac {\partial Q}{\partial z}= \frac {\partial R}{\partial y}\] on a simply connected domain.

These three equations say no more than that mixed second partial derivatives of \(f\) agree, since \(P = f_x\), \(Q = f_y\) and \(R = f_z\) would give \(P_y = f_{xy} = f_{yx} = Q_x\), and likewise for the other two. They are quick to check, and they are the standard test for whether looking for a potential is worth the effort.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.