# PlanetPhysics/Laplacian in Spherical Coordinates

The Laplacian operator in spherical coordinates is
   $\nabla _{sph}^{2}={\frac {1}{r^{2}}}{\frac {\partial }{\partial r}}\left(r^{2}{\frac {\partial }{\partial r}}\right)+{\frac {1}{r^{2}sin\theta }}{\frac {\partial }{\partial \theta }}\left(sin\theta {\frac {\partial }{\partial \theta }}\right)+{\frac {1}{r^{2}sin^{2}\theta }}{\frac {\partial ^{2}}{\partial \phi ^{2}}}$
The derivation is fairly straight forward and begins with locating a vector {\mathbf r} in spherical coordinates as shown in the figure.
\begin{figure} \includegraphics[scale=.698]{SphericalCoordinates.eps} \caption{Spherical Coordinates} \end{figure}
The z component of the unit vector in direction of {\mathbf r} is given from the simple right triangle
$cos\theta ={\frac {z}{|{\hat {r}}|}}$
Since a unit vector has a length of 1, the z component is
$z=cos\theta$
To get the x component, we need to get the ${\hat {r}}$ projected onto the xy-plane
$cos(90-\theta )={\frac {|{\hat {r}}_{xy}|}{|{\hat {r}}|}}$
using the trig identity $cos(90-\theta )=sin\theta$
the projected unit vector is
$|{\hat {r}}_{xy}|=sin\theta$
Finally, the x component is reached through the right triangle
$cos\phi ={\frac {x}{|{\hat {r}}_{xy}|}}$
giving
$x=cos\phi \,sin\theta$
the y component follows the x component through
$sin\phi ={\frac {y}{|{\hat {r}}_{xy}|}}$
which yields
$y=sin\phi \,sin\theta$
The vector in spherical coordinates is then
   ${\mathbf {r} }=r{\hat {r}}=r[sin\theta \,cos\phi \,{\hat {i}}+sin\theta \,sin\phi \,{\hat {j}}+cos\theta \,{\hat {k}}]$
Now describing the unit vectors of a moving particle ${\hat {r}},{\hat {\theta }},{\hat {\phi }}$ shown in the spherical coordinates figure is a little more tricky. If a particle moves in the ${\hat {r}}$ direction, it only moves in or out along r so
${\frac {\partial {\mathbf {r} }}{\partial r}}=k{\hat {r}}$
For ${\hat {\theta }}$ and ${\hat {\phi }}$, think of uniform circular motion like a record, so they can be calculated from
${\hat {\theta }}={\frac {\frac {\partial {\mathbf {r} }}{\partial \theta }}{|{\frac {\partial {\mathbf {r} }}{\partial \theta }}|}}$
${\hat {\theta }}={\frac {\frac {\partial {\mathbf {r} }}{\partial \phi }}{|{\frac {\partial {\mathbf {r} }}{\partial \phi }}|}}$
Next, take the partial derivatives of (2) and then calculate their magnitudes to get the above unit vectors.
${\frac {\partial {\mathbf {r} }}{\partial \theta }}=r[cos\theta \,cos\phi {\hat {i}}+cos\theta \,sin\phi {\hat {j}}-sin\theta {\hat {k}}]$
${\frac {\partial {\mathbf {r} }}{\partial \phi }}=r[-sin\theta \,sin\phi {\hat {i}}+sin\theta \,cos\phi {\hat {j}}]$
$|{\frac {\partial {\mathbf {r} }}{\partial \theta }}|={\sqrt {{\mathbf {x} }\cdot {\mathbf {x} }}}={\sqrt {r^{2}[cos^{2}\theta \,cos^{2}\phi +cos^{2}\theta \,sin^{2}\phi +sin^{2}\theta ]}}$
$|{\frac {\partial {\mathbf {r} }}{\partial \theta }}|=r{\sqrt {cos^{2}\theta (cos^{2}\phi +sin^{2}\phi )+sin^{2}\theta ]}}$
Using the basic trig identity
$|{\frac {\partial {\mathbf {r} }}{\partial \theta }}|=r$
$|{\frac {\partial {\mathbf {r} }}{\partial \phi }}|=r{\sqrt {sin^{2}\theta (sin^{2}\phi +cos^{2}\phi )]}}$
$|{\frac {\partial {\mathbf {r} }}{\partial \phi }}|=rsin\theta$
Then plug in these values to get
${\hat {\phi }}=-sin\phi {\hat {i}}+cos\phi {\hat {j}}$ ${\hat {\theta }}=cos\theta \,cos\phi {\hat {i}}+cos\theta \,sin\phi {\hat {j}}-sin\theta {\hat {k}}$
and from before we had
${\hat {r}}=sin\theta \,cos\phi {\hat {i}}+sin\theta \,sin\phi {\hat {j}}+cos\theta {\hat {k}}$
The generalized differential for curvilinear coordinates is
$d{\mathbf {r} }={\frac {\partial {\mathbf {r} }}{\partial u_{1}}}du_{1}+{\frac {\partial {\mathbf {r} }}{\partial u_{2}}}du_{2}+{\frac {\partial {\mathbf {r} }}{\partial u_{3}}}du_{3}$
For spherical coordinates we have
$u_{1}=r$ $u_{2}=\theta$ $u_{3}=\phi$
and from earlier we learned
$|{\frac {\partial {\mathbf {r} }}{\partial r}}|{\hat {r}}={\frac {\partial {\mathbf {r} }}{\partial r}}$
$|{\frac {\partial {\mathbf {r} }}{\partial \theta }}|{\hat {\theta }}={\frac {\partial {\mathbf {r} }}{\partial \theta }}$
$|{\frac {\partial {\mathbf {r} }}{\partial \phi }}|{\hat {\theta }}={\frac {\partial {\mathbf {r} }}{\partial \phi }}$
Plugging these values into the generalized differential yields
$d{\mathbf {r} }=dr{\hat {r}}+rd\theta {\hat {\theta }}+rsin\theta d\phi {\hat {\phi }}$
The next major step is to see how the gradient fits into the definition of the differential for a function f
$df={\frac {\partial f}{\partial r}}dr+{\frac {\partial f}{\partial \theta }}d\theta +{\frac {\partial f}{\partial \phi }}d\phi$ $df=\nabla f\cdot d{\mathbf {r} }$
So we see that the following must be equal and we need to solve for the gradient's components.
${\frac {\partial f}{\partial r}}dr=\nabla _{r}fdr$ ${\frac {\partial f}{\partial \theta }}d\theta =\nabla _{\theta }fd\theta$ ${\frac {\partial f}{\partial \phi }}d\phi =\nabla _{\phi }fd\phi$
Therfore our scale factors are
$\nabla _{r}=1$ $\nabla _{\theta }={\frac {1}{r}}$ $\nabla _{\phi }={\frac {1}{rsin\theta }}$
which finally gives us the gradient in spherical coordinates
$\nabla _{sph}={\frac {\partial }{\partial r}}{\hat {r}}+{\frac {\partial }{\partial \theta }}{\frac {\hat {\theta }}{r}}+{\frac {\partial }{\partial \phi }}{\frac {\hat {\phi }}{rsin\theta }}$
The last tedious calculation is then the Laplacian, which is our goal
$\nabla ^{2}=\nabla \cdot \nabla =\left({\frac {\partial }{\partial r}}{\hat {r}}+{\frac {\partial }{\partial \theta }}{\frac {\hat {\theta }}{r}}+{\frac {\partial }{\partial \phi }}{\frac {\hat {\phi }}{rsin\theta }}\right)\cdot \left({\frac {\partial }{\partial r}}{\hat {r}}+{\frac {\partial }{\partial \theta }}{\frac {\hat {\theta }}{r}}+{\frac {\partial }{\partial \phi }}{\frac {\hat {\phi }}{rsin\theta }}\right)$
Let us break it up by components to make it easy to view, so carrying out only part of the dot product our 1st term is
${\hat {r}}\cdot \left({\frac {\partial {\hat {r}}}{\partial r}}{\frac {\partial }{\partial r}}+{\hat {r}}{\frac {\partial ^{2}}{\partial r^{2}}}+{\frac {\partial {\hat {\theta }}}{\partial r}}{\frac {1}{r}}{\frac {\partial }{\partial \theta }}+{\hat {\theta }}{\frac {\partial }{\partial r}}{\frac {1}{r}}{\frac {\partial }{\partial \theta }}+{\frac {\hat {\theta }}{r}}{\frac {\partial ^{2}}{\partial r\partial \theta }}+{\frac {\partial {\hat {\phi }}}{\partial r}}{\frac {1}{rsin\theta }}{\frac {\partial }{\partial \phi }}+{\hat {\phi }}{\frac {\partial }{\partial r}}\left({\frac {1}{rsin\theta }}\right){\frac {\partial }{\partial \phi }}+{\frac {\hat {\phi }}{rsin\theta }}{\frac {\partial ^{2}}{\partial r\partial \phi }}\right)$
While this looks a little scary, all but the 2nd term is zero. The first term is zero because there is no r in ${\hat {r}}$
${\hat {r}}=sin\theta \,cos\phi {\hat {i}}+sin\theta \,sin\phi {\hat {j}}+cos\theta {\hat {k}}$
so taking the derivative with respect to r yeilds zero. Similarly, the 3rd and 6th term are zero when taking the partial derivatives. The 4th,5th,7th and 8th terms are zero because the dot product of two orthogonal vectors ($90^{o}$) is zero so
${\hat {r}}\cdot {\hat {\theta }}=0$ ${\hat {r}}\cdot {\hat {\phi }}=0$
This leaves only the second term
   ${\hat {r}}\cdot {\hat {r}}{\frac {\partial ^{2}}{\partial r^{2}}}={\frac {\partial ^{2}}{\partial r^{2}}}$
Now onto the ${\hat {\theta }}$ term
${\frac {\hat {\theta }}{r}}\cdot \left({\frac {\partial {\hat {r}}}{\partial \theta }}{\frac {\partial }{\partial r}}+{\hat {r}}{\frac {\partial ^{2}}{\partial \theta \partial r}}+{\frac {\partial {\hat {\theta }}}{\partial \theta }}{\frac {1}{r}}{\frac {\partial }{\partial \theta }}+{\hat {\theta }}{\frac {\partial }{\partial \theta }}{\frac {1}{r}}{\frac {\partial }{\partial \theta }}+{\frac {\hat {\theta }}{r}}{\frac {\partial ^{2}}{\partial \theta ^{2}}}+{\frac {\partial {\hat {\phi }}}{\partial \theta }}{\frac {1}{rsin\theta }}{\frac {\partial }{\partial \phi }}+{\hat {\phi }}{\frac {\partial }{\partial \theta }}\left({\frac {1}{rsin\theta }}\right){\frac {\partial }{\partial \phi }}+{\frac {\hat {\phi }}{rsin\theta }}{\frac {\partial ^{2}}{\partial \theta \partial \phi }}\right)$
The dot product gets rid of the 2nd, 3rd, 7th and 8th terms, while the 4th and 6th terms are zero when taking the derivatives
${\frac {\partial }{\partial \theta }}{\frac {1}{r}}=0$ ${\frac {\partial {\hat {\phi }}}{\partial \theta }}=0$
Two terms remain, for the first term we need to calculate
${\frac {\partial {\hat {r}}}{\partial \theta }}=cos\theta \,cos\phi {\hat {i}}+cos\theta \,sin\phi {\hat {j}}-sin\theta {\hat {k}}={\hat {\theta }}$
This yields
   ${\frac {\hat {\theta }}{r}}\cdot {\hat {\theta }}{\frac {\partial }{\partial r}}={\frac {1}{r}}{\frac {\partial }{\partial r}}$
The 5th term is just the dot product
   ${\frac {\hat {\theta }}{r}}\cdot {\frac {\hat {\theta }}{r}}{\frac {\partial ^{2}}{\partial \theta ^{2}}}={\frac {1}{r^{2}}}{\frac {\partial ^{2}}{\partial \theta ^{2}}}$
Finally, the ${\hat {\phi }}$ part of the dot product is
${\frac {\hat {\phi }}{rsin\theta }}\cdot \left({\frac {\partial {\hat {r}}}{\partial \phi }}{\frac {\partial }{\partial r}}+{\hat {r}}{\frac {\partial ^{2}}{\partial \phi \partial r}}+{\frac {\partial {\hat {\theta }}}{\partial \phi }}{\frac {1}{r}}{\frac {\partial }{\partial \theta }}+{\hat {\theta }}{\frac {\partial }{\partial \phi }}{\frac {1}{r}}{\frac {\partial }{\partial \theta }}+{\frac {\hat {\theta }}{r}}{\frac {\partial ^{2}}{\partial \phi \partial \theta }}+{\frac {\partial {\hat {\phi }}}{\partial \phi }}{\frac {1}{rsin\theta }}{\frac {\partial }{\partial \phi }}+{\hat {\phi }}{\frac {\partial }{\partial \phi }}\left({\frac {1}{rsin\theta }}\right){\frac {\partial }{\partial \phi }}+{\frac {\hat {\phi }}{rsin\theta }}{\frac {\partial ^{2}}{\partial \phi ^{2}}}\right)$
Once again the dot product makes the 2nd, 4th and 5th terms zero. The first term derivative
${\frac {\partial {\hat {r}}}{\partial \phi }}=-sin\theta \,sin\phi {\hat {i}}+sin\theta \,cos\phi {\hat {j}}=sin\theta {\hat {\phi }}{\frac {\partial }{\partial r}}$
this leads to
   ${\frac {\hat {\phi }}{rsin\theta }}\cdot sin\theta {\hat {\phi }}{\frac {\partial }{\partial r}}={\frac {1}{r}}{\frac {\partial }{\partial r}}$
The 3rd term derivative is
${\frac {\partial {\hat {\theta }}}{\partial \phi }}=-cos\theta \,sin\phi {\hat {i}}+cos\theta \,cos\phi {\hat {j}}=cos\theta {\hat {\phi }}$
this leads to
   ${\frac {\hat {\phi }}{rsin\theta }}\cdot cos\theta {\hat {\phi }}{\frac {1}{r}}{\frac {\partial }{\partial \theta }}={\frac {cos\theta }{r^{2}sin\theta }}{\frac {\partial }{\partial \theta }}$
The 6th term can be seen to be zero because the derivative of ${\hat {\phi }}$ with respect to $\phi$ is a vector perpendicular to ${\hat {\phi }}$ (feel free to carry out this calculation), so the dot product will be zero.
The 7th term derivative is zero
${\frac {\partial }{\partial \phi }}\left({\frac {1}{rsin\theta }}\right)=0$
Then we keep the 8th term
   ${\frac {\hat {\phi }}{rsin\theta }}\cdot {\frac {\hat {\phi }}{rsin\theta }}{\frac {\partial ^{2}}{\partial \phi ^{2}}}={\frac {1}{r^{2}sin^{2}\theta }}{\frac {\partial ^{2}}{\partial \phi ^{2}}}$
Putting the results from (3),(4),(5),(6),(7) and (8) we get
$\nabla _{sph}^{2}={\frac {\partial ^{2}}{\partial r^{2}}}+{\frac {1}{r}}{\frac {\partial }{\partial r}}+{\frac {1}{r^{2}}}{\frac {\partial ^{2}}{\partial \theta ^{2}}}+{\frac {1}{r}}{\frac {\partial }{\partial r}}+{\frac {cos\theta }{r^{2}sin\theta }}{\frac {\partial }{\partial \theta }}+{\frac {1}{r^{2}sin^{2}\theta }}{\frac {\partial ^{2}}{\partial \phi ^{2}}}$
Certainly, we could finish here, but let us combine some terms and notice the following relationships (check these for yourself)
$\left[{\frac {\partial ^{2}}{\partial r^{2}}}+{\frac {2}{r}}{\frac {\partial }{\partial r}}\right]={\frac {1}{r^{2}}}{\frac {\partial }{\partial r}}\left(r^{2}{\frac {\partial }{\partial r}}\right)$
$\left[{\frac {1}{r^{2}}}{\frac {\partial ^{2}}{\partial \theta ^{2}}}+{\frac {cos\theta }{r^{2}sin\theta }}{\frac {\partial }{\partial \theta }}\right]={\frac {1}{r^{2}sin\theta }}{\frac {\partial }{\partial \theta }}\left(sin\theta {\frac {\partial }{\partial \theta }}\right)$
This gives us the equation given in (1), the Laplacian in spherical coordinates
$\nabla _{sph}^{2}={\frac {1}{r^{2}}}{\frac {\partial }{\partial r}}\left(r^{2}{\frac {\partial }{\partial r}}\right)+{\frac {1}{r^{2}sin\theta }}{\frac {\partial }{\partial \theta }}\left(sin\theta {\frac {\partial }{\partial \theta }}\right)+{\frac {1}{r^{2}sin^{2}\theta }}{\frac {\partial ^{2}}{\partial \phi ^{2}}}$
{\mathbf References}
[1] Marsden, J., Tromba, A. "Vector Calculus" Fourth Edition. W.H. Freeman Company, 1996.
[2] Ellis, R., Gulick, D. "Calculus" Harcourt Brace Jovanovich, Inc., Orlando, FL, 1991.
[3] Benbrook, J. "Intermediate Electromagnetic Theory", lecture notes, University of Houston, Fall 2002.