# Line element (dl) in spherical coordinates derivation/diagram

I'm trying to figure out how to derive the formula for an infinitesimal length $\mathrm dl$, specifically, the first formula in this Wikipedia section:

$$\mathrm d\mathbf r=\mathrm dr\hat{\boldsymbol r}+r\mathrm d\theta\hat{\boldsymbol \theta}+r\sin\theta\mathrm d\varphi\hat{\boldsymbol\varphi}\;,$$

where $\hat{\boldsymbol r}$, $\hat{\boldsymbol\theta}$ and $\hat{\boldsymbol\varphi}$ are mutually orthogonal unit vectors in the directions of increasing $r$, $\theta$ and $\varphi$, respectively.

If I could see a good diagram it would probably be enough, but I can't find any.

-
To be able to rigorously derive the formula, you need to use the change of variables theorem and show that in the special case of spherical coordinates it yields the desired result; no pictures are needed. Indeed, according to C. H. Edwards, c.f, Advanced Calculus of Several Variables p 244, such pictures are "mythical" in any event. – ItsNotObvious Oct 21 '11 at 1:55
I added the formula from the linked section. Questions should ideally be self-contained, so that they retain their value in the future despite changes in any content linked to. If you don't know how to achieve a certain result in $\TeX$, you can right-click on any formula on this site and select "Show Source" to see how it was done. – joriki Oct 21 '11 at 6:09

The general form of the formula you refer to is

$$\mathrm d\mathbf r=\sum_i\frac{\partial \mathbf r}{\partial x_i}\mathrm dx_i=\sum_i\left\lvert\frac{\partial \mathbf r}{\partial x_i}\right\rvert\;\frac{\frac{\partial \mathbf r}{\partial x_i}}{\left\lvert\frac{\partial \mathbf r}{\partial x_i}\right\rvert}\mathrm dx_i=\sum_i\left\lvert\frac{\partial \mathbf r}{\partial x_i}\right\rvert\;\mathrm dx_i\hat{\boldsymbol x}_i\;,$$

that is, the change in $\mathbf r$ is decomposed into individual changes corresponding to changes in the individual coordinates. To apply this to the present case, you need to calculate how $\mathbf r$ changes with each of the coordinates. With the conventions being used, we have

$$\mathbf r=\pmatrix{r\sin\theta\cos\varphi\\r\sin\theta\sin\varphi\\r\cos\theta}\;.$$

Thus

$$\frac{\partial\mathbf r}{\partial r}=\pmatrix{\sin\theta\cos\varphi\\\sin\theta\sin\varphi\\\cos\theta}\;,$$ $$\frac{\partial\mathbf r}{\partial \theta}=\pmatrix{r\cos\theta\cos\varphi\\r\cos\theta\sin\varphi\\-r\sin\theta}\;,$$ $$\frac{\partial\mathbf r}{\partial \varphi}=\pmatrix{-r\sin\theta\sin\varphi\\r\sin\theta\cos\varphi\\0}\;.$$

Then the desired coefficients are the magnitudes of these vectors:

$$\begin{eqnarray} \left\lvert\frac{\partial\mathbf r}{\partial r}\right\rvert&=&1\;,\\ \left\lvert\frac{\partial\mathbf r}{\partial \theta}\right\rvert&=&r\;,\\ \left\lvert\frac{\partial\mathbf r}{\partial \varphi}\right\rvert&=&r\sin\theta\;. \end{eqnarray}$$

-