3  Differential operators

3.1 Differentiating scalar fields

The gradient of a scalar field \(f:\Real^3\to\Real\) is the operator \[ \grad f\Big|_{\xb} = \lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_{S}f\hat{\nb}\,dS, \] where \(S\) is a closed surface around \(\xb\) with outward normal \(\hat{\nb}\), enclosed volume \(|V|\), and diameter \(\mathrm{d}(S)=\sup_{\xb, \yb \in S}|\xb-\yb|\).

Note that \(\grad f\) is a vector field \(\Real^3\to\Real^3\). The intuition is that it points in the direction of fastest increase of \(f\), and its magnitude tells you the maximum rate of increase.

Picturing the integral definition of gradient.

To ensure that the limit is well defined, we typically assume that \(f\) is continuously differentiable or more briefly (differentiability class) \(C^1\). We will discuss this in Topic 6, but it just means that \(f\) has continuous partial derivatives.

Proposition 3.1 In Cartesian coordinates, \[ \grad f = \ddy{f}{x}\eb_1 + \ddy{f}{y}\eb_2 + \ddy{f}{z}\eb_3. \]

In particular, Proposition 3.1 shows that \(\grad f\) is a differential operator, acting on a scalar field and returning a vector field.

Proposition 3.1 is the (hopefully) familiar formula from Calculus I, but the integral definition of \(\grad f\) is nicer theoretically because it is manifestly independent of any particular choice of coordinates.

Using Proposition 3.1 we obtain \[ \grad f = \ddy{}{x}(y+x^2)\eb_1 + \ddy{}{y}(y+x^2)\eb_2 = 2x\eb_1 + \eb_2. \] [It can be found directly from the limit definition, but would never normally be computed that way.]

To prove Proposition 3.1 we will need the following.

Lemma 3.1 (Mean Value Theorem for Double Integrals) If a scalar field \(f:\Real^2\to\Real\) is continuous on a closed, bounded and connected domain \(A\subset\Real^2\) then there exists \(\xb_*\in A\) such that \[ \int_Af\,dS = |A|\,f(\xb_*). \]

Lemma 3.1 says that there is some particular point \(\xb_*\) where \(f\) attains its average value, \(f(\xb_*)=\displaystyle\frac{1}{|A|}\int_A f\,dS\).

The analogous 1-d result says for \(f(x)\) is continuous on \([a,b]\), there exists \(x_*\in[a,b]\) such that \(\displaystyle\int_a^bf(x)\,dx = (b-a)f(x_*)\).

Mean Value Theorem for Integrals in 1-d.

Proof. Under the given conditions, we know that \(f\) attains both its maximum and minimum on \(A\), say at some points \(\xb_{\rm max}, \xb_{\rm min}\). We also know that \[ |A|f(\xb_{\rm min}) \leq \int_Af\,dS \leq |A|f(\xb_{\rm max}). \quad \textrm{($\dagger$)} \] Now let \(\xb(t)\) parametrise a curve in \(A\) such that \(\xb(t_0)=\xb_{\rm min}\) and \(\xb(t_1)=\xb_{\rm max}\), and consider the function \[ g(t) = |A|f(\xb(t)). \] This is continuous with \(g(t_0)=|A|f(\xb_{\rm min})\) and \(g(t_1) = |A|f(\xb_{\rm max})\), so by the Intermediate Value Theorem and (\(\dagger\)) there exists \(t_*\) with \[ g(t_*) = \int_Af\,dS. \] Then at \(\xb_*=\xb(t_*)\) we have \(|A|f(\xb_*) =\displaystyle \int_A f\,dS\), as required.


Proof (of Proposition 3.1). To find the \(\eb_1\) component of \(\grad f\), let \(V\) be a small cylinder of radius \(\varepsilon\) and length \(h\), whose axis is the unit vector \(\eb_1\). The volume of the cylinder is \(|V|=\pi\varepsilon^2h\).

The infinitesimal cylinder.

Then \[\begin{align*} \eb_1\cdot\grad f &= \lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_Sf\eb_1\cdot\hat{\nb}\,dS\\ &= \lim_{\varepsilon,h\to 0}\frac{1}{\pi\varepsilon^2h}\left[\int_{S_1}f\,dS -\int_{S_0}f\,dS\right] \quad \textrm{[since $\eb_1\cdot\hat{\nb}=0$ on the curved surface]}\\ &= \lim_{\varepsilon,h\to 0}\frac{1}{\pi\varepsilon^2h}\Big[\pi\varepsilon^2f(\xb_1) - \pi\varepsilon^2f(\xb_0)\Big] \end{align*}\] for some \(\xb_1\in S_1\) and \(\xb_0\in S_0\), by Lemma 3.1. Taking the \(\varepsilon\) limit, these points tend to the centre of their faces by the Squeezing Theorem, so \[\begin{align*} \eb_1\cdot\grad f &= \lim_{h\to 0}\frac{f(\xb + h\eb_1) - f(\xb)}{h} = \ddy{f}{x}. \end{align*}\] The other components are obtained analogously.


Proposition 3.2 In curvilinear coordinates \((u,v,w)\), the gradient has the expression \[ \grad f = \frac{1}{h_u}\ddy{f}{u}\eb_u + \frac{1}{h_v}\ddy{f}{v}\eb_v + \frac{1}{h_w}\ddy{f}{w}\eb_w. \]

Proof. This is an easy consequence of Proposition 3.1. Note that \[ \eb_u\cdot\grad f = \left(\frac{1}{h_u}\ddy{\xb}{u}\right)\cdot\grad f = \frac{1}{h_u}\left(\ddy{x}{u}\ddy{f}{x} + \ddy{y}{u}\ddy{f}{y} + \ddy{z}{u}\ddy{f}{z}\right) = \frac{1}{h_u}\ddy{f}{u}, \] where the last step used the Chain Rule. The \(\eb_v\) and \(\eb_w\) components are analogous.


In Cartesians, we have \[ \grad(z) = \ddy{z}{x}\eb_1 + \ddy{z}{y}\eb_2 + \ddy{z}{z}\eb_3 = \eb_3. \] In spherical coordinates \((r,\theta,\phi)\), recall that \(z=r\cos\theta\). So Proposition 3.2 gives \[\begin{align*} \grad(r\cos\theta) &= \frac{1}{h_r}\ddy{}{r}(r\cos\theta)\eb_r + \frac{1}{h_\theta}\ddy{}{\theta}(r\cos\theta)\eb_\theta + \frac{1}{h_\phi}\ddy{}{\phi}(r\cos\theta)\eb_\phi\\ &= \ddy{}{r}(r\cos\theta)\eb_r + \frac{1}{r}\ddy{}{\theta}(r\cos\theta)\eb_\theta\\ &= \cos\theta\eb_r - \sin\theta\eb_\theta. \end{align*}\] We recognise this as \(\eb_3\) again.

Observe that our coordinate formula, and hence \(\grad f\), extends to scalar fields on any \(\Real^n\), and giving always a vector in \(\Real^n\).

Very high-dimensional vectors are commonly used in machine learning algorithms.

3.2 Differentiating vector fields

There are two standard ways to differentiate a vector field \(\fb:\Real^3\to\Real^3\), defined in a similar way to the gradient as follows. Again, \(S\) is a closed surface enclosing \(\xb\) with outward normal \(\hat{\nb}\), enclosed volume \(|V|\), and diameter \(\mathrm{d}(S)\).

  1. The divergence of \(\fb\) is the scalar field \[ \grad\cdot\fb\Big|_{\xb} = \lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_{S}\hat{\nb}\cdot\fb\,dS. \]
  2. The curl of \(\fb\) is the vector field \[ \grad\times\fb\Big|_{\xb} = \lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_{S}\hat{\nb}\times\fb\,dS. \]

Again, to ensure that these limits are well-defined, it suffices for \(\fb\) to be \(C^1\). (Proving this is beyond the scope of this course.)

The intuition for divergence is that it measures whether (on average) the vector field is pointing outward (\(\grad\cdot\fb > 0\)) or inward (\(\grad\cdot\fb <0\)) at a particular point.

Idea of divergence.

The intuition for curl is that it measures how much (on average) the vector field at a particular point is rotating around any given axis.

Idea of curl.

Just like the gradient, we will derive coordinate expressions for the divergence and curl that show they are both differential operators. We need the following simple result.

Lemma 3.2 If \(\ab\in\Real^3\) is a constant vector and \(f:\Real^3\to\Real\) is a \(C^1\) scalar field, then

(i) \(\grad\cdot(f\ab) = (\grad f)\cdot\ab\),

(ii) \(\grad\times(f\ab) = (\grad f)\times\ab\).

Proof. These formulae follow from the integral definitions of \(\grad\cdot\fb\) and \(\grad\times\fb\). In particular, \[ \grad\cdot(f\ab) = \lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_{S}\hat{\nb}\cdot(f\ab)\,dS = \left(\lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_{S}f\hat{\nb}\,dS\right)\cdot\ab = (\grad f)\cdot\ab, \] and \[ \grad\times(f\ab) = \lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_{S}\hat{\nb}\times(f\ab)\,dS = \left(\lim_{\mathrm{d}(S)\to 0}\frac{1}{|V|}\oint_{S}f\hat{\nb}\,dS\right)\times\ab = (\grad f)\times\ab. \] [We used the fact that \(\ab\) was constant to take it outside of the integrals.]


Proposition 3.3 In Cartesian coordinates, divergence and curl are given by

(i) \(\displaystyle\grad\cdot\fb = \ddy{f_1}{x} + \ddy{f_2}{y} + \ddy{f_3}{z}.\)

(ii) \(\grad\times\fb = \begin{vmatrix} \eb_1 & \eb_2 & \eb_3\\ \displaystyle\ddy{}{x} & \displaystyle\ddy{}{y} & \displaystyle\ddy{}{z}\\ f_1 & f_2 & f_3 \end{vmatrix} = \displaystyle\left(\ddy{f_3}{y} - \ddy{f_2}{z}\right)\eb_1 + \left(\ddy{f_1}{z} - \ddy{f_3}{x}\right)\eb_2 + \left(\ddy{f_2}{x} - \ddy{f_1}{y}\right)\eb_3.\)

In particular, this shows clearly that they really are differential operators. It also justifies the dot and cross notation, if you think of \(\grad\) as a vector operator \(\displaystyle\grad = \eb_1\ddy{}{x} + \eb_2\ddy{}{y} + \eb_3\ddy{}{z}\).

Proof. (i) Using Lemma 3.2 (i), we have \[\begin{align*} \grad\cdot\fb &= \grad\cdot(f_1\eb_1 + f_2\eb_2 + f_3\eb_3)\\ &= \grad\cdot(f_1\eb_1) + \grad\cdot(f_2\eb_2) + \grad\cdot(f_3\eb_3) \quad \textrm{[since the divergence is clearly linear]}\\ &= (\grad f_1)\cdot\eb_1 + (\grad f_2)\cdot\eb_2 + (\grad f_3)\cdot\eb_3\\ &= \ddy{f_1}{x} + \ddy{f_2}{y} + \ddy{f_3}{z}. \quad \textrm{[from definition of the gradient]} \end{align*}\]

(ii) Using Lemma 3.2 (ii), we have that \[ \grad\times(f_1\eb_1) = (\grad f_1)\times\eb_1 = \ddy{f_1}{y}\eb_2\times\eb_1 + \ddy{f_1}{z}\eb_3\times\eb_1 = -\ddy{f_1}{y}\eb_3 + \ddy{f_1}{z}\eb_2. \] The other terms are obtained similarly.


Recall that these were the “sink” and “inward spiral”:

Using Proposition 3.3, the divergences are \[\begin{align*} \grad\cdot\fb &= \ddy{f_1}{x} + \ddy{f_2}{y} + \ddy{f_3}{z} = \ddy{}{x}(-x) + \ddy{}{y}(-y) + \ddy{}{z}(-z) = -3,\\ \grad\cdot\gb &= \ddy{g_1}{x} + \ddy{g_2}{y} + \ddy{g_3}{z} = \ddy{}{x}(y-x) + \ddy{}{y}(-x-y) = -2. \end{align*}\] Both are negative, consistent with the fact that they were pointed “inward”.

The curls are \[\begin{align*} \grad\times\fb &= \begin{vmatrix} \eb_1 & \eb_2 & \eb_3\\ \displaystyle\ddy{}{x} & \displaystyle\ddy{}{y} & \displaystyle\ddy{}{z}\\ -x & -y & -z \end{vmatrix}= \left(-\ddy{z}{y} + \ddy{y}{z}\right)\eb_1 + \left(-\ddy{x}{z} + \ddy{z}{x}\right)\eb_2 + \left(-\ddy{y}{x} + \ddy{x}{y}\right)\eb_3 = \bfzero,\\ \grad\times\gb &= \begin{vmatrix} \eb_1 & \eb_2 & \eb_3\\ \displaystyle\ddy{}{x} & \displaystyle\ddy{}{y} & \displaystyle\ddy{}{z}\\ y-x & -x-y & 0 \end{vmatrix} = \ddy{}{z}(x+y)\eb_1 + \ddy{}{z}(y-x)\eb_2 + \left(\ddy{}{x}(-x-y) - \ddy{}{y}(y-x) \right)\eb_3 = -2\eb_3. \end{align*}\] The fact that \(\grad\times\fb=\bfzero\) makes sense since \(\fb\) is purely “radial”.

The fact that \(\eb_3\cdot\grad\times\gb < 0\) is consistent with the clockwise rotation of this vector field. Note that a vector field that is independent of \(z\) can never have an “in-plane” component of curl.

[In general the divergence and curl would not be constant in space: this arises because of the linearity of \(\fb\) and \(\gb\) in this simple example.]

Corollary 3.1 If \(f:\Real^3\to\Real\) is a scalar field, and \(\fb:\Real^3\to\Real^3\) is a vector field, both with continuous second derivatives, then

(i) \(\grad\cdot(\grad\times\fb) \equiv 0\),

(ii) \(\grad\times(\grad f) \equiv \bfzero\).

Proof. Note that the expressions on the left are independent of any particular choice of coordinates. So it suffices to prove the identities in Cartesian coordinates, for which we can use Proposition 3.3.

For (i), \[\begin{align*} \grad\cdot(\grad\times\fb) &= \ddy{}{x}\left(\ddy{f_3}{y} - \ddy{f_2}{z}\right) + \ddy{}{y}\left(\ddy{f_1}{z} - \ddy{f_3}{x}\right) + \ddy{}{z}\left(\ddy{f_2}{x} - \ddy{f_1}{y}\right)\\ &= \ddy{^2f_1}{y\partial z} - \ddy{^2f_1}{z\partial y} + \ddy{^2f_2}{z\partial x} - \ddy{^2f_2}{x\partial z} + \ddy{^2f_2}{x\partial y} - \ddy{^2f_3}{y\partial x} = 0 \end{align*}\] where the mixed partial derivatives commute because they are continuous.

For (ii), \[\begin{align*} \grad\times(\grad f) &= \left(\ddy{^2f}{y\partial z} - \ddy{^2f}{z\partial y}\right)\eb_1 + \left(\ddy{^2f}{z\partial x} - \ddy{^2f}{x\partial z}\right)\eb_2 + \left(\ddy{^2f}{x\partial y} - \ddy{^2f}{y\partial x}\right)\eb_3 = \bfzero. \end{align*}\]


The fact that \(\displaystyle\ddy{^2f}{x\partial y} = \ddy{^2f}{y\partial x}\) if both sides are continuous is called Clairaut’s Theorem.

Like the gradient, the definition of divergence extends readily to \(\Real^n\) for any \(n\geq 1\). The surface \(S\) becomes a closed \((n-1)\)-dimensional hypersurface given by a map \(\Real^{n-1}\to\Real^n\).

For example, when \(n=2\) the hypersurface \(S\) is just a curve \(C\), and its enclosed “volume” is the area \(A\) enclosed by the curve. So \[ \grad\cdot\fb\Big|_{\Real^2} := \lim_{\mathrm{d}(C)\to 0}\frac{1}{|A|}\oint_C\hat{\nb}\cdot\fb\,d\ell = \ddy{f_1}{x} + \ddy{f_2}{y}. \]

On the other hand, curl exists only in \(\Real^3\) because it relies on the cross product \(\hat{\nb}\times\fb\).

3.3 Product rules

Recall the domains and ranges of the three derivative operators, as in the following diagram.

The derivative operators.

A consequence is that instead of the single product rule from single-variable calculus, there are now six!

Proposition 3.4 (Product rules) If \(f, g:\Real^3\to\Real\) are scalar fields, and \(\fb, \gb:\Real^3\to\Real^3\) are vector fields, all \(C^1\), then

(i) \(\grad(fg) \equiv g\grad{f} + f\grad{g}\),

(ii) \(\grad\cdot(g\fb) \equiv (\grad g)\cdot\fb + g\grad\cdot\fb\),

(iii) \(\grad\cdot(\fb\times\gb) \equiv \gb\cdot(\grad\times\fb) - \fb\cdot(\grad\times\gb)\),

(iv) \(\grad\times(g\fb) \equiv g(\grad\times\fb) + (\grad g)\times\fb\),

(v) \(\grad\times(\fb\times\gb) \equiv (\gb\cdot\grad)\fb - (\fb\cdot\grad)\gb + \fb(\grad\cdot\gb) - \gb(\grad\cdot\fb)\).

(vi) \(\grad(\fb\cdot\gb) \equiv (\gb\cdot\grad)\fb + (\fb\cdot\grad)\gb + \fb\times(\grad\times\gb) + \gb\times(\grad\times\fb)\).

Proof. Again, it suffices to prove these identities in Cartesian coordinates.

(i) We use the regular (single-variable) product rule to obtain \[\begin{align*} \grad(fg) &= \ddy{}{x}(fg)\eb_1 + \ddy{}{y}(fg)\eb_2 + \ddy{}{z}(fg)\eb_3\\ &= \left(\ddy{f}{x}g + f\ddy{g}{x}\right)\eb_1 + \left(\ddy{f}{y}g + f\ddy{g}{y}\right)\eb_2 + \left(\ddy{f}{z}g + f\ddy{g}{z}\right)\eb_3\\ &= \left(\ddy{f}{x}\eb_1 + \ddy{f}{y}\eb_2 + \ddy{f}{z}\eb_3\right)g + f\left(\ddy{g}{x}\eb_1 + \ddy{g}{y}\eb_2 + \ddy{g}{z}\eb_3\right)\\ &= g\grad f + f\grad g. \end{align*}\]

(ii) By Lemma 3.2 (i) we have \[\begin{align*} \grad\cdot(g\fb) &= \grad\cdot\Big(gf_1\eb_1 + gf_2\eb_2 + gf_3\eb_3\Big)\\ &= \grad(gf_1)\cdot\eb_1 + \grad(gf_2)\cdot\eb_2 + \grad(gf_3)\cdot\eb_3\\ &= f_1\grad g\cdot\eb_1 + g\grad f_1\cdot\eb_1 + f_2\grad g\cdot\eb_2 + g\grad f_2\cdot\eb_2 + f_3\grad g\cdot\eb_3 + g\grad f_3\cdot\eb_3\\ &= (\grad g)\cdot\Big(f_1\eb_1 + f_2\eb_2 + f_3\eb_3\Big) + g\left(\ddy{f_1}{x} + \ddy{f_2}{y} + \ddy{f_3}{z}\right)\\ &= (\grad g)\cdot\fb + g\grad\cdot\fb. \end{align*}\]

(iii) Evaluating the cross product first gives \[\begin{align*} \grad\cdot(\fb\times\gb) &= \grad\cdot\begin{vmatrix} \eb_1 & \eb_2 & \eb_3\\ f_1 & f_2 & f_3\\ g_1 & g_2 & g_3 \end{vmatrix}\\ &= \ddy{}{x}\left(f_2g_3 - f_3g_2\right) + \ddy{}{y}\left(f_3g_1 - f_1g_3\right) + \ddy{}{z}\left(f_1g_2 - f_2g_1\right)\\ &= g_1\left(\ddy{f_3}{y} - \ddy{f_2}{z}\right) + g_2\left(\ddy{f_1}{z} - \ddy{f_3}{x}\right) + g_3\left(\ddy{f_2}{x} - \ddy{f_1}{y}\right)\\ &\qquad + f_1\left(\ddy{g_2}{z} - \ddy{g_3}{y}\right) + f_2\left(\ddy{g_3}{x} - \ddy{g_1}{z}\right) + f_3\left(\ddy{g_1}{y} - \ddy{g_2}{x}\right)\\ &= \gb\cdot(\grad\times\fb) - \fb\cdot(\grad\times\gb). \end{align*}\] [Note the minus sign here, expected since \(\fb\times\gb\) is antisymmetric.]

(iv) By Lemma 3.2 (ii), we have \[\begin{align*} \grad\times(g\fb) &= \grad\times(gf_1\eb_1 + gf_2\eb_2 + gf_3\eb_3)\\ &= \grad(gf_1)\times\eb_1 + \grad(gf_2)\times\eb_2 + \grad(gf_3)\times\eb_3\\ &= \ddy{}{y}(gf_1)\eb_2\times\eb_1 + \ddy{}{z}(gf_1)\eb_3\times\eb_1 + \ddy{}{x}(gf_2)\eb_1\times\eb_2 + \ddy{}{z}(gf_2)\eb_3\times\eb_2\\ &\qquad + \ddy{}{x}(gf_3)\eb_1\times\eb_3 + \ddy{}{y}(gf_3)\eb_2\times\eb_3\\ &= -\ddy{}{y}(gf_1)\eb_3 + \ddy{}{z}(gf_1)\eb_2 + \ddy{}{x}(gf_2)\eb_3 - \ddy{}{z}(gf_2)\eb_1 - \ddy{}{x}(gf_3)\eb_2 + \ddy{}{y}(gf_3)\eb_1\\ &= g\left[\left(\ddy{f_3}{y} - \ddy{f_2}{z}\right)\eb_1 + \left(\ddy{f_1}{z} - \ddy{f_3}{x}\right)\eb_2 + \left(\ddy{f_2}{x} - \ddy{f_1}{y}\right)\eb_3\right]\\ &\qquad \left(\ddy{g}{y}f_3 - \ddy{g}{z}f_2\right)\eb_1 + \left(\ddy{g}{z}f_1 - \ddy{g}{x}f_3\right)\eb_2 + \left(\ddy{g}{x}f_2 - \ddy{g}{y}f_1\right)\eb_3\\ &= g(\grad\times\fb) + (\grad g)\times\fb. \end{align*}\] [Be careful of the order in the second term!]

(v) and (vi). We defer the proof of these to Topic 5 when we learn a less cumbersome notation.


Start from the right-hand side, and apply Proposition 3.4 (iv) with \(g=u\) and \(\fb=\grad v\) \[ \grad\times(u\grad v) = u\grad\times (\grad v) + (\grad u)\times(\grad v). \] By Corollary 3.1 (ii), the curl of a gradient vanishes, so \(\grad\times(\grad v)=\bfzero\) and we recover the left-hand side.

3.4 Divergence and curl in curvilinear coordinates

We can use some of our vector identities to derive the following.

Proposition 3.5 In orthogonal curvilinear coordinates \((u,v,w)\), the divergence and curl are given by

(i) \(\displaystyle\grad\cdot\fb = \frac{1}{h_uh_vh_w}\left[\ddy{}{u}(h_vh_wf_u) + \ddy{}{v}(h_uh_wf_v) + \ddy{}{w}(h_uh_vf_w)\right].\)

(ii) \(\grad\times\fb = \displaystyle \frac{1}{h_uh_vh_w}\begin{vmatrix} h_u\eb_u & h_v\eb_v & h_w\eb_w\\ \displaystyle\ddy{}{u} & \displaystyle\ddy{}{v} & \displaystyle\ddy{}{w}\\ h_uf_u & h_vf_v & h_wf_w \end{vmatrix}.\)

Proof. First, note from Proposition 3.2 that \(\displaystyle\grad v = \frac{1}{h_v}\eb_v\), so \(\eb_v=h_v\grad v\), and similarly \(\eb_w=h_w\grad w\).

For (i), note that using orthogonality followed by Proposition 3.4 (ii), we get \[\begin{align*} \grad\cdot(f_u\eb_u) &= \grad\cdot(f_u\eb_v\times\eb_w)\\ &= \grad\cdot(f_uh_vh_w\grad v\times\grad w)\\ &= \grad(f_u h_vh_w)\cdot\grad v\times\grad w + f_uh_vh_w\grad\cdot(\grad v\times\grad w)\\ &= \grad(f_u h_vh_w)\cdot\grad v\times\grad w + f_uh_vh_w\grad\cdot(\grad \times[v\grad w]) \quad\textrm{[from previous lecture]}\\ &= \grad(f_u h_vh_w)\cdot\grad v\times\grad w \quad\textrm{[using $\grad\cdot(\grad\times\fb) \equiv 0$]}\\ &= \grad(f_u h_vh_w)\cdot\frac{\eb_v\times\eb_w}{h_vh_w}\\ &= \frac{1}{h_vh_w}\eb_u\cdot\grad(f_u h_vh_w)\\ &= \frac{1}{h_uh_vh_w}\ddy{}{u}(h_vh_wf_u), \end{align*}\] where the last step used Proposition 3.2. The other components are similar.

For (ii), we use \(\eb_u = h_u\grad u\) and Proposition 3.4 (iv) to find \[\begin{align*} \grad\times(f_u\eb_u) &= \grad\times(f_uh_u\grad u)\\ &= \grad(f_u h_u)\times\grad u + f_uh_u\grad\times\grad u\\ &= \grad(f_u h_u)\times\grad u \quad \textrm{[using $\grad\times\grad f = 0$]}\\ &= \frac{1}{h_u}\grad(f_uh_u)\times\eb_u\\ &= \frac{1}{h_u}\grad(f_uh_u)\times(\eb_v\times\eb_w)\\ &= \frac{1}{h_u}\eb_v[\eb_w\cdot\grad(f_uh_u)] - \eb_w[\eb_v\cdot\grad(f_uh_u)]\\ &= \frac{1}{h_uh_w}\ddy{}{w}(h_uf_u)\eb_v - \frac{1}{h_uh_v}\ddy{}{v}(h_uf_u)\eb_w. \end{align*}\] The penultimate step used the vector triple product identity \(\ab\times(\bb\times\cb) = \bb(\ab\cdot\cb) - \cb(\ab\cdot\bb)\). Again, the other components are similar.


The dot and cross notation can be misleading here. For example, note that \[ \grad\cdot\fb \neq \frac{1}{h_u}\ddy{f_u}{u} + \frac{1}{h_v}\ddy{f_v}{v} + \frac{1}{h_w}\ddy{f_w}{w}. \] This doesn’t work because we assumed in the proof of Proposition 3.3 that the unit vectors \(\eb_1\), \(\eb_2\), \(\eb_3\) were constant vectors. But although \(\eb_u\), \(\eb_v\), \(\eb_w\) are unit vectors, they are not constant vectors because their direction varies in space.

Working directly from Proposition 3.5 (ii), with the scale factors for spherical coordinates, we have \[\begin{align*} \grad\times\fb &= \frac{1}{h_rh_\theta h_\phi}\begin{vmatrix} h_r\eb_r & h_\theta\eb_\theta & h_\phi\eb_\phi\\ \displaystyle\ddy{}{r} & \displaystyle\ddy{}{\theta} & \displaystyle\ddy{}{\phi}\\ h_r f_r & h_\theta f_\theta & h_\phi f_\phi \end{vmatrix}= \frac{1}{r^2\sin\theta}\begin{vmatrix} \eb_r & r\eb_\theta & r\sin\theta\eb_\phi\\ \displaystyle\ddy{}{r} & \displaystyle\ddy{}{\theta} & \displaystyle\ddy{}{\phi}\\ f_r & r f_\theta & r\sin\theta f_\phi \end{vmatrix}\\ &= \frac{1}{r^2\sin\theta}\begin{vmatrix} \eb_r & r\eb_\theta & r\sin\theta\eb_\phi\\ \displaystyle\ddy{}{r} & \displaystyle\ddy{}{\theta} & \displaystyle\ddy{}{\phi}\\ 0 & 0 & r^2\sin^2\theta \end{vmatrix}= \frac{1}{r^2\sin\theta}\eb_r\ddy{}{\theta}(r^2\sin^2\theta) - \frac{1}{r\sin\theta}\eb_\theta\ddy{}{r}(r^2\sin^2\theta)\\ &= \frac{2\sin\theta\cos\theta r^2}{r^2\sin\theta}\eb_r - \frac{2r\sin^2\theta}{r\sin\theta}\eb_\theta = 2(\cos\theta\eb_r - \sin\theta\eb_\theta). \end{align*}\]

Alternatively, we could first write \(\fb\) in Cartesian coordinates using our expression for \(\eb_\phi\) from Tutorial Sheet 1, to see that \[ \fb(\xb) = r\sin\theta(-\sin\phi\eb_1 + \cos\phi\eb_2) = -r\sin\theta\sin\phi\eb_1 + r\sin\theta\cos\phi\eb_2 = -y\eb_1 + x\eb_2. \] Then compute the curl using the Cartesian formula: \[ \grad\times\fb = \begin{vmatrix} \eb_1 & \eb_2 & \eb_3\\ \displaystyle\ddy{}{x} & \displaystyle\ddy{}{y} & \displaystyle\ddy{}{z}\\ -y & x & 0 \end{vmatrix} = 2\eb_3. \] From Tutorial Sheet 1, we recognise that this is the same vector field written in the Cartesian basis.