[Math] Gradient in Spherical coordinates

coordinate systemsmultivariable-calculuspartial derivativespherical coordinatesvector analysis

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?

Best Answer

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