Every differentiable function $f$ comes with a vector field: its gradient $\nabla f$, computed at every point. These gradient fields are the most important vector fields in the course, because many physical fields are gradients: gravity, the electric field of charges, the flow of heat (which goes against the temperature gradient).
Key idea
At each point, $\nabla f$ is perpendicular to the level curve of $f$ through it and points in the direction in which $f$ increases fastest.
A word about signs. In mathematics we call $f$ a potential when $\mathbf{F} = \nabla f$. Physicists usually write $\mathbf{F} = -\nabla U$ with a potential energy $U$, so that forces push toward lower energy. The two differ only by a minus sign: $U = -f$.
Why it works
Why the arrows cross the level curves at right angles: along a level curve $\mathbf{r}(t)$, $f(\mathbf{r}(t))$ is constant, so by the chain rule $\nabla f \cdot \mathbf{r}'(t) = 0$.
Worked examples
Worked example: A gradient field
- $f_x = 2xy$ (treat $y$ as a constant) and $f_y = x^2 + 3y^2$.
- $\nabla f = \langle 2xy, x^2 + 3y^2 \rangle$.
- Check the test: $P_y = 2x$ and $Q_x = 2x$. Equal, as they must be.
Answer: $\langle 2xy, x^2 + 3y^2 \rangle$
Worked example: In space, at a point
- $f_x = yz + e^x$, $f_y = xz$, $f_z = xy$.
- At $(0, 1, 2)$: $\langle 2 + 1, 0, 0 \rangle = \langle 3, 0, 0 \rangle$.
- So at that point $f$ increases fastest in the $+x$ direction, at rate ${}3$.
Answer: $\langle yz + e^x, xz, xy \rangle$; $\langle 3, 0, 0 \rangle$ at $(0, 1, 2)$
Worked example: Not a gradient field
- $P = y$ gives $P_y = 1$; $Q = -x$ gives $Q_x = -1$.
- $P_y \ne Q_x$, so no function $f$ has $\nabla f = \mathbf{F}$.
- Picture: this field circles the origin clockwise. A gradient field cannot circle back on itself, since following it always takes you uphill on $f$.
Answer: no