Gradient, divergence, and curl

All three of these operators are different ways of representing the rate of change of a function of several variables.

Gradient

The gradient is an operator that takes a scalar valued function of several variables and gives a vector. It is one way of encoding the rate of change of a scalar function with respect to several variables. Formally, :(RnR)(RnRn)\nabla : (\mathbb R^n \to \mathbb R) \to \mathbb (\mathbb R^n \to \mathbb R^n), and

=(x1x2xn)\nabla = \begin{pmatrix}\frac{\partial}{\partial x_1} \\ \frac{\partial}{\partial x_2} \\ \vdots \\ \frac{\partial}{\partial x_n}\end{pmatrix}

For example, consider the function f(x,y,z)=2x2+3y4zf(x, y, z) = 2x^2 + 3y - 4z. The gradient of ff would be:

f=(xyz)f=(fxfyfz)=(4x34) \nabla f = \begin{pmatrix}\frac{\partial}{\partial x} \\ \frac{\partial}{\partial y} \\ \frac{\partial}{\partial z}\end{pmatrix} f = \begin{pmatrix}f_x \\ f_y \\ f_z\end{pmatrix} = \begin{pmatrix}4x \\ 3 \\ -4\end{pmatrix}

Properties

Geometrically, the gradient points in the direction of fastest increase of a function, and its magnitude is the rate of change in that direction. If you follow the gradient of a function you will eventually either get to a local maximum or infinity.

Divergence

The divergence represents how quickly a vector valued function is “spreading out”. Note that unlike the gradient, divergence operates on a vector valued function function F(x1,x2,,xn):RnRn=(f1,f2,,fn)\mathbf F(x_1, x_2, \cdots, x_n) : \mathbb R^n \to \mathbb R^n = (f_1, f_2, \cdots, f_n) and gives us a scalar R\mathbb R. It is formally defined as follows:

div(F)=F=f1x1+f2x2++fnxn\mathrm{div}(\mathbf F) = \nabla \cdot \mathbf F = \frac{\partial f_1}{\partial x_1} + \frac{\partial f_2}{\partial x_2} + \cdots + \frac{\partial f_n}{\partial x_n}

Properties

div(curl(F)))=0\mathrm{div}(\mathrm{curl}(\mathbf F))) = 0.

Curl

The curl is similar to divergence except instead of the dot product it is the cross product:

curl(F)=×F\mathrm{curl}(\mathbf F) = \nabla \times \mathbf F

The curl represents how quickly and in what direction a vector field is “spinning”. Since the curl is a vector, it points along the axis of rotation following the right hand rule.

Note that the curl is sometimes defined in R2\mathbb R^2 in addition to R3\mathbb R^3, even though the cross product is only defined in R3\mathbb R^3. This is because in 2 dimensions the axis of rotation is always either out of the page (counter-clockwise) or into the page (clockwise), which we can represent simply as a signed scalar (positive and negative, respectively; following the right hand rule).

We evaluate the curl of a 2D vector field on the x,yx,y plane like so:

(xyz)×(xy0)=(00yxxy)curl(xy)=yxxy \begin{align*} \begin{pmatrix}\frac{\partial}{\partial x} \\ \frac{\partial}{\partial y} \\ \frac{\partial}{\partial z}\end{pmatrix} \times \begin{pmatrix}x \\ y \\ 0\end{pmatrix} &= \begin{pmatrix} 0 \\ 0 \\ y_x - x_y \end{pmatrix} \\ \mathrm{curl}\begin{pmatrix}x\\y\end{pmatrix} &= y_x - x_y \end{align*}

Note that we just take the zz component, since the axis of rotation is always ±z\pm z.

Properties

curl(f)=0\mathrm{curl}(\nabla f) = \mathbf 0.