4.2 Gradients
Gradient Fields
If \(f\) is a scalar function of two variables, its gradient, \[\nabla f(x,y) = f_x(x,y)\,\mathbf i + f_y(x,y)\,\mathbf j ,\] is a vector field on \(\mathbb {R}^2\), the gradient field of \(f\) (also written \(\grad f\)). Similarly, for a function of three variables, \[\nabla f(x,y,z) = f_x(x,y,z)\,\mathbf i + f_y(x,y,z)\,\mathbf j + f_z(x,y,z)\,\mathbf k .\]
Example 4.2.1. Find the gradient vector field of \(f(x,y) = x^2 + y^2\). Plot it together with a contour map of \(f\), and say how the two are related.
Solution. \[\nabla f(x,y) = f_x\,\mathbf i + f_y\,\mathbf j = 2x\,\mathbf i + 2y\,\mathbf j = 2(x\,\mathbf i + y\,\mathbf j).\] 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\,\mathbf i,\qquad \nabla f(-1,0)= -2\,\mathbf i,\qquad \nabla f(0,1) = 2\,\mathbf j,\qquad \nabla f(0,-1) = -2\,\mathbf j.\] The level curves \(f(x,y) = k\) are the circles \(x^2+y^2 = k\), centred at the origin.
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 \(\mathbf F\) is called conservative if it is the gradient of some scalar function, that is, if there is a function \(f\) with \(\mathbf F = \nabla f\). The function \(f\) is then called a potential for \(\mathbf F\). The gravitational field of Example 4.1.5 is conservative, with potential \(f(\mathbf x) = \frac {mMG}{|\mathbf x|}\), since \(\nabla |\mathbf x|^{-1} = -|\mathbf x|^{-3}\mathbf x\) (Example 4.3.1 with \(n = -1\)).
Theorem 4.2.2. Let \(\mathbf F = P\,\mathbf i + Q\,\mathbf j + R\,\mathbf k\) have continuous first partial derivatives on a simply connected domain (defined in the subsection on line integrals of vector fields). Then \(\mathbf F\) is the gradient of a function \(f\) if and only if \[\frac {\partial P}{\partial y} = \frac {\partial Q}{\partial x} ,\qquad \frac {\partial R}{\partial x} = \frac {\partial P}{\partial z} ,\qquad \frac {\partial Q}{\partial z}= \frac {\partial R}{\partial y} .\] For a field \(P\,\mathbf i + Q\,\mathbf j\) in the plane the single condition is \(P_y = Q_x\).
The necessity of these equations is easy: if \(P = f_x\), \(Q = f_y\) and \(R = f_z\) with continuous second derivatives, then \(P_y = f_{xy} = f_{yx} = Q_x\), and likewise for the other two, since mixed partial derivatives agree. Sufficiency, which needs the domain to have no holes, is proved through line integrals in the subsection on the fundamental theorem of line integrals. The equations are quick to check, and they are the standard test for whether looking for a potential is worth the effort.
Example 4.2.3. Is \(\mathbf F = (x - y)\,\mathbf i + (x - 2)\,\mathbf j\) conservative? Is \(\mathbf G = (3 + 2xy)\,\mathbf i + (x^2 - 3y^2)\,\mathbf j\)?
Solution. For \(\mathbf F\), \(P_y = -1\) but \(Q_x = 1\), so \(\mathbf F\) is not conservative. For \(\mathbf G\), \(P_y = 2x = Q_x\), and the domain is the whole plane, so \(\mathbf G\) is conservative; a potential is found in Example 4.7.3.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.