# Del operator ($\nabla$) in spherical co-ordinate system

I am teaching myself about vector fields and came across the following question:

Is the following force field $\vec{F}$ conservative, where $\vec{F}(r,\theta,\varphi)$ is defined by: $$F_{r}=2ar\sin(\theta)\sin(\varphi),\: F_{\theta}=ar\cos(\theta)\sin(\varphi),\: F_{\varphi}=ar\cos(\varphi)$$

A simple test to determine whether a force field is conservative is to see if the following is true: $$\nabla\times \vec{F}=\vec{0}$$

Where by abuse of notation we have: $$\nabla=\frac{\partial \hat{\boldsymbol{\imath}}}{\partial x}+\frac{\partial \hat{\boldsymbol{\jmath}}}{\partial y}+\frac{\partial \hat{\boldsymbol{k}}}{\partial z}$$

However, as we are using a curvilinear co-ordinate basis I'm not sure how $\nabla$ should be defined?

Further to JohnD's answer, I have tried to derive his expression for $\nabla$, however, I have not managed to come to the right answer.

Taking partial derivatives of $r$ with respect to $x,y$ and $z$ we get:

\begin{align}\frac{\partial r}{\partial x}&=\frac{x}{\sqrt{x^{2}+y^{2}+z^{2}}}=\sin(\theta)\cos(\varphi) \\ \frac{\partial r}{\partial y}&= \frac{y}{\sqrt{x^{2}+y^{2}+z^{2}}}=\sin(\theta)\sin(\varphi) \\ \frac{\partial r}{\partial z} &= \frac{z}{\sqrt{x^{2}+y^{2}+z^{2}}}=\cos(\theta)\end{align}

Our partial derivatives of $\theta$ with respect to our cartesian co-ordinates are:

\begin{align}\frac{\partial \theta}{\partial x}&= \frac{z\frac{\partial r}{\partial x}}{\sqrt{r^{2}-z^{2}}}=\frac{r\cos(\theta)\sin(\theta)\cos(\varphi)}{r\sqrt{1-\cos^{2}(\theta)}}=\cos(\theta)\cos(\varphi) \\ \frac{\partial \theta}{\partial y}&=\frac{z\frac{\partial r}{\partial y}}{\sqrt{r^{2}-z^{2}}}=\frac{r\cos(\theta)\sin(\theta)\sin(\varphi)}{r\sqrt{1-\cos^{2}(\theta)}}=\cos(\theta)\sin(\varphi) \\ \frac{\partial \theta}{\partial z} &= \frac{z\frac{\partial r}{\partial z}-r}{r\sqrt{r^{2}-z^{2}}} = \frac{r\cos^{2}(\theta)-r}{r\sqrt{r^{2}-r^{2}\cos^{2}(\theta)}}=-\frac{\sin(\theta)}{r}\end{align}

And finally partial derivatives of $\varphi$:

\begin{align}\frac{\partial \varphi}{\partial x}&=-\frac{y}{x^{2}(1+\frac{y^{2}}{x^{2}})}=-\frac{r\sin(\theta)\sin(\varphi)}{r^{2}\sin^{2}(\theta)\cos^{2}(\theta)(1+\tan^{2}(\varphi))}=-\frac{\sin(\varphi)}{r} \\ \frac{\partial \varphi}{\partial y}&=\frac{1}{x(1+\frac{y^2}{x^{2}})}=\frac{1}{r\sin(\theta)\cos(\varphi)(1+\tan^{2}(\varphi))}=\frac{\cos(\varphi)}{r\sin(\theta)} \\ \frac{\partial \varphi}{\partial z}&=0\end{align}

We therefore get:

\begin{align}\frac{\partial}{\partial x}&\mapsto \sin(\theta)\cos(\varphi)\frac{\partial}{\partial r}+\cos(\theta)\cos(\varphi)\frac{\partial}{\partial \theta} - \frac{\sin(\varphi)}{r}\frac{\partial}{\partial \varphi} \\ \frac{\partial}{\partial y} &\mapsto \sin(\theta)\sin(\varphi)\frac{\partial}{\partial r} + \cos(\theta)\sin(\varphi)\frac{\partial}{\partial \theta} + \frac{\cos(\varphi)}{r\sin(\theta)}\frac{\partial}{\partial \varphi} \\ \frac{\partial}{\partial z} &\mapsto \cos(\theta)\frac{\partial}{\partial r} - \frac{\sin(\theta)}{r}\frac{\partial}{\partial \theta}\end{align}

However summing coefficients of $\frac{\partial}{\partial r}$, $\frac{\partial}{\partial \theta}$ and $\frac{\partial}{\partial \varphi}$ doesn't give what is expected, so what have I done wrong?

• See Del symbol in curlinear coordinate Dec 25, 2013 at 14:22

You've written $\nabla$ a bit confusingly. It may be clearer to write it (in Cartesian) as

$$\nabla = \hat i \frac{\partial}{\partial x} + \hat j \frac{\partial}{\partial y} + \hat k \frac{\partial}{\partial z}$$

This makes clear that the partial derivatives aren't of the basis vectors.

In general, $\nabla$ uses a basis of dual (or "cotangent") vectors. For a Cartesian basis, the dual basis vectors are identical to the ordinary basis vectors, so this property is somewhat less apparent.

The natural basis vectors associated with a spherical coordinate system are

\begin{align*} e_r &\equiv \frac{\partial}{\partial r} \vec r = \hat r \\ e_\theta &\equiv \frac{\partial}{\partial \theta} \vec r = r \hat \theta \\ e_\varphi &\equiv \frac{\partial}{\partial \varphi} \vec r = r \hat \varphi \sin \theta \end{align*}

The dual basis vectors--$e^r, e^\theta, e^\varphi$--can be directly computed using a triple product formula:

$$e^r = \frac{e_\theta \times e_\varphi}{e_r \cdot (e_\theta \times e_\varphi)}$$

...and similarly for $e^\theta, e^\varphi$ by permutation of variables, but since the coordinate system is orthogonal, all you really have to do is divide by the squared magnitude of each basis vector. Hence,

\begin{align*} e^r &= e_r \\ e^\theta &= \frac{e_\theta}{r^2} = \frac{\hat \theta}{r} \\ e^\varphi &= \frac{e_\varphi}{r^2 \sin^2 \theta} = \frac{\hat \varphi}{r \sin \theta} \end{align*}

Once the dual basis vectors are known, the expression for $\nabla$ follows:

\begin{align*} \nabla &= e^r \frac{\partial}{\partial r} + e^\theta \frac{\partial}{\partial \theta} + e^\varphi \frac{\partial}{\partial \varphi} \\ &= \hat r \frac{\partial}{\partial r} + \frac{1}{r} \hat \theta \frac{\partial}{\partial \theta} + \frac{1}{r \sin \theta} \hat \varphi \frac{\partial}{\partial \varphi}\end{align*}

• Where on earth does that triple product come from? How can we get dual vectors from only vector products? Nov 24, 2019 at 4:12
• @Craig The "dual" (more properly reciprocal) basis vectors are exactly those vectors which are orthogonal to the hyperplanes you can form with the basis vectors and whose magnitudes are reciprocal. So if $e_1, e_2, e_3$ is our basis, there are three (hyper)planes we can form as the span of each possible pair of basis vectors: $$\{e_2,e_3\},\quad\{e_1,e_3\},\quad\{e_1,e_2\}.$$ $e^1,e^2,e^3$ are then respectively the vectors orthogonal to these planes with magnitudes and orientations such that $e^i\cdot e_i = 1$ (hence the term "reciprocal"). May 16 at 17:32
• Note that this implies $$|e^i| = \frac1{|e_i||\cos\theta_{i,jk}|}$$ with $i,j,k$ any permutation of $1,2,3$ and $\theta_{i,jk}$ the angle between $e_i$ and $e_j\times e_k$. Now divide $|e_j\times e_k|$ by the triple product $|e_i\cdot(e_j\times e_k)$|; you get the correct magnitude for $e^i$. May 16 at 17:32

In spherical coordinates, $x=r\sin\theta\cos\varphi$, $y=r\sin\theta\sin\varphi$, $z=r\cos\theta$. Use this change of variables in conjunction with the multivariable chain rule to express ${\partial \over \partial x}$, ${\partial \over \partial y}$, ${\partial \over \partial z}$ in terms of $r,\theta,\varphi$ to obtain $$\nabla_\text{spherical}=\left\langle {\partial\over \partial r},{1\over r}{\partial\over \partial\theta},{1\over r\sin\theta}{\partial\over \partial \varphi}\right\rangle.$$

The chart linked in the comment above is a very helpful reference.

• Thank you for your helpful answer, I tried to perform a change of variable (as per the update in my question) however I didn't get the right answer; would you mind having a look through it? Thanks! Dec 25, 2013 at 17:13
##### Answer to Question about $$\overset{\rightarrow} {\boldsymbol \nabla}$$ in Spherical Coordinates

Inevitably, calculation of Curl or Divergence is defined in terms of formulas that are independent of the coordinate system. However, to convert these formulas to coordinate-system values, the length-metrics of the coordinate system need to be applied.

From "Divergence in curvilinear coordinates", the formula for Divergence $$\overset{\rightarrow} {\boldsymbol \nabla} \bullet \overset{\rightarrow} {\boldsymbol E}$$ can be determined (Quoting the Answer from TurlocTheRed) as follows:

By definition: $$\vec{\nabla} \cdot \vec{E}=\lim_{\Delta V\to 0 }\frac{\int \vec{E}\cdot \hat{n}dA}{\Delta V} =\lim_{\Delta V\to 0} \frac{\int E_in_ih_jh_kdx_jdx_k +\int E_jn_jh_ih_kdx_idx_k+ \int E_kn_kh_jh_idx_jdx_i}{\int h_ih_jh_kdx_idx_jdx_k}$$ $$= \frac{1}{h_ih_jh_k}\left(\frac{\partial(E_ih_jh_k) }{\partial x_i }+\frac{\partial(E_jh_ih_k) }{\partial x_j }+ \frac{\partial(E_kh_jh_i) }{\partial x_k } \right)$$

The reason to start with the Divergence in general curvilinear coordinates for $$\vec{\nabla}\bullet \vec{E}$$ is that its formula is very similar to the formula for the Divergence in Cartesian Coordinates, just with a few additional scaling parameters. The derivation for the $$\vec{\nabla}\times\left(\vec{D}\right)= \vec{\nabla}\times\left(\vec{B}\times\vec{C}\right)$$ triple cross product is given in this reference here. The quantity $$\vec{D}$$ can be constructed taking advantage of the Curvilinear Coordinate unit vectors as a cross product of unit vectors times a scalar $$D$$.

This Curl answer is also covered in one of the fundamental books on the subject, namely Phillip's Vector Analysis, starting from pages 82 onward. Basically what is being attempted is a change of coordinates to demonstrate that $$\boldsymbol {\overset \rightarrow {\nabla}}$$ acts like a vector quantity. The below references from Phillip's Vector analysis.

However, there is something important to consider, aside from the coordinate transformation. That is, that when a differential operator acts on a product, then the Chain Rule needs to be applied.

Since the question is focused on the cross product curl, the curl is (in spherical coordinates, from a Wikipedia reference):

Notice that it is not a coordinate simple transformation, as the referenced curl has the chain rule applied to each coordinate to arrive at its result.

##### Deriving the Curl in Spherical Coordinates from First Principles

The first step is to derive $$\boldsymbol {\overset \rightarrow C}=\boldsymbol {\overset \rightarrow B} \times \boldsymbol {\overset \rightarrow A}\text{ }$$ in Spherical Coordinates. Afterwards $$\boldsymbol {\overset \rightarrow B}\text{ }$$ can be converted to the differential operator $$\boldsymbol {\overset \rightarrow \nabla}$$ using the Calculus Chain Rule. In this way, the reference from Wikipedia can be verified. This is accomplished using the coordinate transformation reference from Phillip's Vector Analysis in the below section about "Additional Considerations...".

Consider the quoted diagram from Wolfram describing Spherical Coordinates:

From this diagram, the following relationships are derived. See this reference (where the terms $$\boldsymbol{\overset{\rightarrow} \theta}$$ and $$\boldsymbol{\overset{\rightarrow} \phi}$$ are swapped and the derivation below conforming to the quoted Wolfram Math reference diagram for Spherical Coordinates: \begin{aligned} &\boldsymbol {\hat{x}}\bullet \boldsymbol {\hat{r}} =\cos(\theta)\sin(\phi), \quad \quad & &\boldsymbol {\hat{x}}\bullet \boldsymbol {\hat{\theta}} = -\sin(\theta), \quad \quad & &\boldsymbol {\hat{x}}\bullet \boldsymbol {\hat{\phi}} =\cos(\theta)\cos(\phi) \\ &\boldsymbol {\hat{y}}\bullet \boldsymbol {\hat{r}} =\sin(\theta)\sin(\phi), \quad \quad & &\boldsymbol {\hat{y}}\bullet \boldsymbol {\hat{\theta}} =\cos(\theta), \quad \quad & &\boldsymbol {\hat{y}}\bullet \boldsymbol {\hat{\phi}} =\sin(\theta)\cos(\phi) \\ &\boldsymbol {\hat{z}}\bullet \boldsymbol {\hat{r}} =\cos(\phi), \quad \quad & &\boldsymbol {\hat{z}}\bullet \boldsymbol {\hat{\theta}} =0, \quad \quad & &\boldsymbol {\hat{z}}\bullet \boldsymbol {\hat{\phi}} =-\sin(\phi) \end{aligned}

Note that the magnitude of $$\boldsymbol {\hat{x}}$$, $$\boldsymbol {\hat{y}}$$, and $$\boldsymbol {\hat{z}}$$ are the derivatives of the length vector $$\boldsymbol {\overset{\rightarrow} r}$$ with respect to the scalar lengths $$x$$, $$y$$, and $$z$$. In a similar way, it is desired that the " $$\boldsymbol {\hat{\text{ }}}$$ " operator is also of magnitude 1 for Spherical coordinates. There is a little bit more difficulty, in that the elements in Spherical Coordinates are as $$A_r$$, $$A_\phi$$ and $$A_\theta$$ where as $$A_r$$ is a length unit, in contrast $$A_\phi$$ is measured in Radians (which is not a length unit), so there is a length metric. A similar for $$A_\theta$$ not being a length but rather being a scaled Radian quantity.

Here, the symbols $$\boldsymbol {\hat{r}}$$, $$\boldsymbol {\hat{\phi}}$$, and $$\boldsymbol {\hat{\theta}}$$ are the derivatives of the length vector $$\boldsymbol {\overset{\rightarrow} r}$$ with respect to the scalar lengths as in: $$\boldsymbol {\hat{r}}=\frac{\partial}{\partial r} \boldsymbol {\overset{\rightarrow} r}\quad\text{,}\quad \boldsymbol {\hat{\phi}}= \frac1{r}\frac{\partial}{\partial \phi} \boldsymbol {\overset{\rightarrow} r}\quad\text{,}\quad \boldsymbol {\hat{\theta}}= \frac1{r \sin(\phi)}\frac{\partial}{\partial \theta} \boldsymbol {\overset{\rightarrow} r}$$

The derived quantities from the diagram have been checked against the Wikipedia reference and are correct. Moreover the determinant of the corresponding matrix is $$-1$$ so as suspected, the above hat transformation is just a change of coordinates involving rotations.

From the above relationships, it is possible to see that $$\boldsymbol {\hat{r}}$$ , $$\boldsymbol {\hat{\phi}}$$ , and $$\boldsymbol {\hat{\theta}}$$ are simple rotations of the $$\boldsymbol {\hat{x}}$$ , $$\boldsymbol {\hat{y}}$$ , and $$\boldsymbol {\hat{z}}$$ , explicitly with the rotational matrix transformation below (derived from the above dot products of the unit vectors above) as follows:

$$\begin{bmatrix} \boldsymbol {\hat{r}} \\ \boldsymbol {\hat{\phi}} \\ \boldsymbol {\hat{\theta}} \\ \end{bmatrix} =T \begin{bmatrix} \boldsymbol {\hat{x}} \\ \boldsymbol {\hat{y}} \\ \boldsymbol {\hat{z}} \\ \end{bmatrix} = \begin{bmatrix} \cos(\theta)\sin(\phi) & \sin(\theta)\sin(\phi) & \cos(\phi) \\ \cos(\theta)\cos(\phi) & \sin(\theta)\cos(\phi) & -\sin(\phi) \\ -\sin(\theta) & \cos(\theta) & 0 \\ \end{bmatrix} \begin{bmatrix} \boldsymbol {\hat{x}} \\ \boldsymbol {\hat{y}} \\ \boldsymbol {\hat{z}} \\ \end{bmatrix}$$
And for the inverse transform $$T^{-1}$$: $$\begin{bmatrix} \boldsymbol {\hat{x}} \\ \boldsymbol {\hat{y}} \\ \boldsymbol {\hat{z}} \\ \end{bmatrix} =T^{-1} \begin{bmatrix} \boldsymbol {\hat{r}} \\ \boldsymbol {\hat{\phi}} \\ \boldsymbol {\hat{\theta}} \\ \end{bmatrix} = \begin{bmatrix} \cos(\theta)\sin(\phi) & \cos(\theta)\cos(\phi) & -\sin(\theta)\\ \sin(\theta)\sin(\phi) & \sin(\theta)\cos(\phi) & \cos(\phi) \\ \cos(\theta) & -\sin(\theta) & 0 \\ \end{bmatrix} \begin{bmatrix} \boldsymbol {\hat{r}} \\ \boldsymbol {\hat{\phi}} \\ \boldsymbol {\hat{\theta}} \\ \end{bmatrix}$$

So since $$\boldsymbol {\hat{r}}$$ , $$\boldsymbol {\hat{\phi}}$$ , and $$\boldsymbol {\hat{\theta}}$$ are just linear rotational transformations T of $$\boldsymbol {\hat{x}}$$ , $$\boldsymbol {\hat{y}}$$, and $$\boldsymbol {\hat{z}}$$.

And also with "The inverse of a matrix", wherever
$$\boldsymbol {\hat{r}}$$ , $$\boldsymbol {\hat{\phi}}$$ , and $$\boldsymbol {\hat{\theta}}$$ are used, their corresponding rotated $$\boldsymbol {\hat{x}}$$ , $$\boldsymbol {\hat{y}}$$, and $$\boldsymbol {\hat{z}}$$ can be applied.

Now apply the chain rule to get $$\boldsymbol {\overset \rightarrow \nabla}$$ in Spherical Coordinates.

##### The Approach Taken by MIT

Using their different definition of Spherical Coordinates, MIT derives the Curl in a Coordinate-Independent form and arrives at the following result as quoted below, and it is not a simple plugin of the gradient vector $$\boldsymbol {\hat{r}}\frac{\partial}{\partial r} + \boldsymbol {\hat{\phi}}\frac1{R}\frac{\partial}{\partial \phi} + \boldsymbol {\hat{\theta}}\frac1{R\sin(\phi)}\frac{\partial}{\partial\theta}$$
into the Determinant :

...

...

This extended quote is taken Phillip's Vector Analysis. Reading the whole book is highly recommended. This just shows how to transform coordinates without taking the step of applying the chain rule (so without applying the chain rule, the coordinate transformation is incomplete for $$\boldsymbol {\overset \rightarrow {\nabla}}$$).