Gradient in Spherical coordinates I'm trying to derive the gradient vector in spherical polar coordinates: $$\nabla = \left( \frac{\partial}{\partial x}, \frac{\partial}{\partial y},\frac{\partial}{\partial z} \right)$$The method I am trying to use is different from most papers/videos I found and I don't understand why it doesn't work. I am able to get expressions for the cartesian differentials: $dx, dy, dz$. First, I am just trying to find $\frac{\partial}{\partial x}$ in spherical coordinates. I have: $$dx= \cos \theta \sin \phi dr + r \cos \theta \cos \phi d \theta + r \sin \theta \sin \phi d \phi$$ This sounds strange but my first intuition was to say that: $$\frac{\partial}{\partial x} = \frac{ \partial }{ \cos \theta \sin \phi dr + r \cos \theta \cos \phi d \theta + r \sin \theta \sin \phi d \phi} $$ Which doesn't seem to make any sense now :(. If my logic is wrong, could someone explain to me why?
 A: This is a classic example of why treating something like $\frac{dy}{dx}$ as a literal fraction rather than as shorthand notation for a limit is bad. If you want to derive it from the differentials, you should compute the square of the line element $ds^2  .$ Start with $$ds^2 = dx^2 + dy^2 + dz^2$$ in Cartesian coordinates and then show
$$ds^2 =  dr^2 + r^2 d\theta^2 + r^2 \sin^2 (\theta) d\varphi^2 \; .$$ The coefficients on the components for the gradient in this spherical coordinate system will be 1 over the square root of the corresponding coefficients of the line element. In other words
$$\nabla f = \begin{bmatrix} \frac{1}{\sqrt{1}}\frac{\partial f}{\partial r} & \frac{1}{\sqrt{r^2}}\frac{\partial f}{\partial \theta} & \frac{1}{\sqrt{r^2\sin^2\theta}}\frac{\partial f}{\partial \varphi} \end{bmatrix} \; .$$ Keep in mind that this gradient has nomalized basis vectors.
For a general coordinate system (which doesn't necessarily have an orthonormal basis), we organize the line element into a symmetric "matrix" with two indices $g_{ij} .$ If the line element contains a term like $f(\mathbf x)dx_kdx_\ell\; \;$ then $g_{k\ell} = f(\mathbf x).\;$  The gradient is then expressed as
$$\nabla f = \sum_i \sum_j \frac{\partial f}{\partial x_i}g^{ij}\mathbf e_j$$ where $\mathbf e_j$ is not necessarily a normalized vector and $g^{ij}$ is the matrix inverse of $g_{ij}$.
A: I am not satisfied with vb628's answer. Even after patryan asked for clarification, and vb628 responded, I am still uncertain why the scaling factors are what they are. Therfore, I undertake my own answer here.

$$\boldsymbol{\nabla}{f} =   \mathbf{e}_r\, \frac{\partial{f}}{\partial{r}}
+
\mathbf{e}_\theta\,\frac{1}{r } \,\frac{\partial{f}}{\partial{\theta}}
 +
\mathbf{e}_\phi\,\frac{1}{r\,\sin{\theta}} \,\frac{\partial{f}}{\partial{\phi}}\qquad\text{in spherical coordinates}.$$

To undertake this derivation I need the result that
\begin{equation*}
d\mathbf{s}
=
\mathbf{e}_r\,dr 
+
\mathbf{e}_\theta\,r\,d\theta 
+
\mathbf{e}_\phi\,r\,  \sin{ \theta} \,d\phi .
\end{equation*}
Please note that $d\mathbf{s}
\cdot d\mathbf{s}
$ gives vb628's result for $ds^2$ found above.
I also need to consider the differential arc length in each of the three directions of the standard spherical basis:
\begin{align*}
ds = 
\begin{cases}
d\mathbf{s} \cdot\mathbf{e}_r =dr,
&
\text{when  arc   constrained to   $\mathbf{ e }_r$ direction;}
\\
d\mathbf{s} \cdot\mathbf{e}_\theta =r \,d\theta,
&
\text{when arc constrained to   $\mathbf{ e }_\theta$ direction; and}
\\
d\mathbf{s} \cdot\mathbf{e}_\phi =r\,  \sin{ \theta} \,d\phi,
&
\text{when arc constrained to  $\mathbf{ e }_\phi$ direction.}
\end{cases}
\end{align*}
According to the definition in [1], $\boldsymbol{\nabla}{f}$ in a direction $\mathbf{u}$ is the directional derivative $df/ds$ in that direction. The element of the archlength $ds$ in the $\mathbf{ e }_r$ direction is $dr$, so
$$\boldsymbol{\nabla}{f}\cdot \mathbf{e}_r 
= \frac{d{f}}{ds} 
= \frac{\partial{f}}{\partial{r}}.$$
Note that I replace  the derivative with the partial derivative to re-enforce  that the arc is constrained to one of the standard basis directions.  Below, I will do the same thing twice more.
Similarly, the element of the archlength $ds$ in the $\mathbf{ e }_\theta$ direction is $r\,d\theta$, so
$$\boldsymbol{\nabla}{f}\cdot \mathbf{e}_\theta 
= \frac{d{f}}{ds} 
= 
\frac{\partial{f}}{r\,\partial{\theta}}.$$
Finaly, the element of the archlength $ds$ in the $\mathbf{ e }_\phi$ direction is $r\,\sin{\theta}\,d\phi$, so
$$\boldsymbol{\nabla}{f}\cdot \mathbf{e}_\phi
=
 \frac{\partial{f}}{r\,\sin{\theta}\,\partial{\phi}}.$$
Thus, in spherical coordinates, we have
$$\boldsymbol{\nabla}{f} =   \mathbf{e}_r\, \frac{\partial{f}}{\partial{r}}
+
\mathbf{e}_\theta\,\frac{1}{r } \,\frac{\partial{f}}{\partial{\theta}}
 +
\mathbf{e}_\phi\,\frac{1}{r\,\sin{\theta}} \,\frac{\partial{f}}{\partial{\phi}}$$
Bibliography
[1] Wikipedia contributors. (2021, January 14). Gradient. In Wikipedia, The Free Encyclopedia. Retrieved 21:38, January 27, 2021, from https://en.wikipedia.org/w/index.php?title=Gradient&oldid=1000232587
