Line element in the spherical polar co-ordinate system:
Let us consider a very small volume element PQRSS’P’Q’R as shown in Fig.1. The lower surface PQRS of this volume element lies on the surface of the sphere of radius \( r \) and the parallel surface P’Q’R’S’ lies on the surface of the sphere of radius \( (r+dr) \). Since the angles \( d\theta \) and \( d\phi \) and radial extension \( dr \) are very small, so the volume element can be assumed as rectangular volume element.

Now the radius vector of P and R’ are \( \vec{r} \) and \( \vec{r}+\vec{dr} \) respectively.
So the line element or length element is \( \vec{PR’}=(\vec{r}+\vec{dr})-\vec{r}=\vec{dr} \)
The spherical polar co-ordinates of the point P are \( (r,\ \theta,\ \phi) \) and the corresponding three dimensional cartesian co-ordinates are \( (x\ ,y\ ,z) \).
Then we can write,
\( x=r\ \sin\theta\ \cos\phi \)
\( y=r\ \sin\theta\ \sin\phi \)
\( z=r\ \cos\theta \)
Now the radial vector of the point \( P \) is
\( \vec{r}=x\hat{i}+y\hat{j}+z\hat{k} \)
\( or,\ \vec{r}= r\ \sin\theta\ \cos\phi\ \hat{i}+ r\ \sin\theta\ \sin\phi\ \hat{j}+ r\ \cos\theta\ \hat{k} \)
where, \( \hat{i} \), \( \hat{j} \), and \( \hat{k} \) are the unit vectors along the direction of X-axis, Y-axis and Z-axis respectively.
Again \( \hat{r} \) be the unit vector along the direction of radial vector \( r \),
then we can write,
\( \hat{r}=\displaystyle{\frac{\vec{r}}{r}}=\sin\theta\ \cos\phi\ \hat{i}+\sin\theta\ \sin\phi\ \hat{j}+\cos\theta\ \hat{k} \)
Now, \( \frac{d\hat{r}}{dt}=\frac{d}{dt}(\sin\theta\ \cos\phi\ \hat{i}+\sin\theta\ \sin\phi\ \hat{j}+\cos\theta\ \hat{k}) \)
or, \( \frac{d\hat{r}}{dt}=(\cos\theta\cos\phi\dot{\theta}-\sin\theta\sin\phi\dot{\phi})\hat{i}\\+(\cos\theta\sin\phi\dot{\theta}+\sin\theta\cos\phi\dot{\phi})\hat{j}\\+(-\sin\theta\dot{\theta})\hat{k} \)
or, \( \frac{d\hat{r}}{dt}=\dot{\theta}(\cos\theta\cos\phi\hat{i}+\cos\theta\sin\phi\hat{j}-\sin\theta\hat{k})\\+\dot{\phi}(-\sin\phi\hat{i}+\cos\phi\hat{j})\sin\theta \)
or, \( \frac{d\hat{r}}{dt}=\dot{\theta}\hat{\theta}+\dot{\phi}\ \sin\theta\ \hat{\phi} \)
where, \( \hat{\theta}=\cos\theta\cos\phi\hat{i}+\cos\theta\sin\phi\hat{j}-\sin\theta\hat{k} \)
and, \( \hat{\phi}=-\sin\phi\hat{i}+\cos\phi\hat{j} \)
where, \( \hat{\theta} \) in the unit vector along the direction of increasing \( \theta \) and \( \hat{\phi} \) is the unit vector along the direction of increasing \( \phi \).
[ To know the expression for the unit vectors \( \hat{thete} \) and \( \hat{\phi} \) in terms of the unit vectors \( \hat{i} \), \( \hat{j} \) and \( \hat{k} \), (CLICK HERE) ]
or,\( \displaystyle{\frac{d\hat{r}}{dt}=\frac{d\theta}{dt}\ \hat{\theta}+\sin\theta\ \frac{d\phi}{dt}\ \hat{\phi}} \)
or, \( d\hat{r}=d\theta\ \hat{\theta}+\sin\theta\ d\phi\ \hat{\phi} \)
Now, \( \displaystyle{\frac{d\vec{r}}{dt}=\frac{d}{dt}(r\hat{r})} \)
or, \( \displaystyle{\frac{\vec{dr}}{dt}=r\frac{d\hat{r}}{dt}+\frac{dr}{dt}\hat{r}} \)
or, \( \vec{dr}=r\ d\hat{r}+dr\ \hat{r} \)
Putting the value of \( \vec{dr} \) we get,
\( \vec{dr}=dr\ \hat{r}+r\ d\theta\ \hat{\theta}+r\ \sin\theta\ d\phi\ \hat{\phi} \)
Since the unit vectors, \( \hat{r} \), \( \hat{\theta} \), \( \hat{\phi} \) are mutually perpendicular to each other,
So the magnitude of the vector \( \vec{dr} \) is
\( dr=|\vec{dr}|=\sqrt{dr^2+r^2\ d{\theta}^2+r^2\ {\sin}^2\theta\ d{\phi}^2} \)