If we have a function $f=f(r, \theta, \phi)$, where $(r, \theta, \phi)$ are spherical coordinates on $\mathbb{R}^3$, how do we compute the gradient $\nabla f$ by using the formula $$\nabla f \cdot d\vec{r} = df ?$$ Here $\vec{r}$ is the position vector and $df=\frac{\partial f}{\partial r}dr +\frac{\partial f}{\partial \theta}d\theta+\frac{\partial f}{\partial \phi}d\phi$.
Derivation of formula for gradient in spherical coordinates
1.4k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
You can use the total derivative concept such as $$df(r,\theta,\phi)=\frac{\partial f}{\partial r}dr+\frac{\partial f}{\partial \theta}d\theta+\frac{\partial f}{\partial \phi}d\phi$$
It basically shows you what will be the change in the function $f$ if you are at the point $(r_0,\theta_0,\phi_0)$ and increase one varible by incremental value of $dr$; $d\theta$; or $d\phi$.
On
$f(r,\theta,\phi)$, or $f(\vec u)$ is a scalar field function, implying that $\nabla f$ stands for the gradient of $f$, which is in spherical coordinates:
$$ \nabla f(\vec u) = [\frac{\partial f(\vec u)}{\partial r}, \frac{1}{r}\frac{\partial f(\vec u)}{\partial \theta}, \frac{1}{r \sin \theta}\frac{\partial f(\vec u)}{\partial \phi}]$$
$d \vec u$ is the change in $\vec u$:
$$ d \vec u = d(r,\theta,\phi )= [dr,d \theta,d \phi] $$
Then $df $ is the change in f, which equals the dot product between $d \vec u$ and $\nabla f$:
$$ df = d \vec u \cdot \nabla f $$ $$ = [\frac{\partial f(\vec u)}{\partial r}, \frac{1}{r}\frac{\partial f(\vec u)}{\partial \theta}, \frac{1}{r \sin \theta}\frac{\partial f(\vec u)}{\partial \phi}] \cdot [dr,d \theta,d \phi] $$ $$ = \frac{\partial f(\vec u)}{\partial r}\partial r + \frac{1}{r}\frac{\partial f(\vec u)}{\partial \theta}\partial \theta + \frac{1}{r \sin \theta}\frac{\partial f(\vec u)}{\partial \phi}\partial \phi $$
which is then a scalar.
$df(\vec u)$ then gives you the change in $f$ at the point $\vec u = [r,\theta,\phi]$.
The gradient emerges as a result of the chain rule due to differentiation in multivar calculus.
The main problem for me to understand the derivation of gradient in spherical coordinates was to realize why ${df=d\vec r\cdot \nabla f}$. I found the answer in a paper about gradient in spherical coordinates and it was: Lets call the distance between two isosurfaces (${f\space and\space f+df}$) ${dl=d\vec r\cdot \frac{\nabla f}{|\nabla f|}}$ and ${df=dl.|\nabla f|}$. From the two equation we can get that ${df=d\vec r\cdot \nabla f}$.