[Math] Derivation of formula for gradient in spherical coordinates

calculusmultivariable-calculuspartial derivative

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$.

Best Answer

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$.