You are on page 1of 6

derivation of the Laplacian from

rectangular to spherical coordinates∗


swapnizzle†
2013-03-21 22:51:43

We begin by recognizing the familiar conversion from rectangular to spherical


coordinates (note that φ is used to denote the azimuthal angle, whereas θ is used
to denote the polar angle)

x = r sin(θ) cos(φ), y = r sin(θ) sin(φ), z = r cos(θ), (1)

and conversely from spherical to rectangular coordinates


! "z # "y#
r = x2 + y 2 + z 2 , θ = arccos , φ = arctan . (2)
r x
Now, we know that the Laplacian in rectangular coordinates is defined1 in the
following way

∂2f ∂2f ∂2f


∇2 f = + + . (3)
∂x2 ∂y 2 ∂z 2
We also know that the partial derivatives in rectangular coordinates can be
expanded in the following way by using the chain rule
∂f ∂f ∂r ∂f ∂θ ∂f ∂φ
= + + , (4)
∂x ∂r ∂x ∂θ ∂x ∂φ ∂x
∂f ∂f ∂r ∂f ∂θ ∂f ∂φ
= + + , (5)
∂y ∂r ∂y ∂θ ∂y ∂φ ∂y
∂f ∂f ∂r ∂f ∂θ ∂f ∂φ
= + + . (6)
∂z ∂r ∂z ∂θ ∂z ∂φ ∂z
The next step is to convert the right-hand side of each of the above three equa-
tions so that it only has partial derivatives in terms of r, θ and φ. We can do
∗ !DerivationOfTheLaplacianFromRectangularToSphericalCoordinates" created: !2013-
03-21" by: !swapnizzle" version: !39376" Privacy setting: !1" !Topic" !53A45"
† This text is available under the Creative Commons Attribution/Share-Alike License 3.0.

You can reuse this document or portions thereof only if you do so under terms that are
compatible with the CC-BY-SA license.
1 Readers should note that we do not have to define the Laplacian this way. A more rigorous

approach would be to define the Laplacian in some coordinate free manner.

1
this by substituting the following values (which are easily derived from (2)) in
their respective places in the above three equations

∂r ∂θ 1 ∂φ 1 sin(φ)
= sin(θ) cos(φ), = cos(θ) cos(φ), =− ,
∂x ∂x r ∂x r sin(θ)
∂r ∂θ 1 ∂φ 1 cos(φ)
= sin(θ) sin(φ), = cos(θ) sin(φ), = ,
∂y ∂y r ∂y r sin(θ)
∂r ∂θ 1 ∂φ
= cos(θ), = − sin(θ), = 0. (7)
∂z ∂z r ∂z
After the substitution, equation (4) looks like the following

∂f ∂f 1 ∂f 1 sin(φ) ∂f
= sin(θ) cos(φ) + cos(θ) cos(φ) − . (8)
∂x ∂r r ∂θ r sin(θ) ∂φ
∂f
Assuming that f is a sufficiently differentiable function, we can replace f by ∂x
in the above equation and arrive at the following

∂2f ∂ $ ∂f % 1 ∂ $ ∂f % 1 sin(φ) ∂ $ ∂f %
= sin(θ) cos(φ) + cos(θ) cos(φ) − (9).
∂x2 ∂r ∂x r ∂θ ∂x r sin(θ) ∂φ ∂x

Now the trick is to substitute equation (8) into equation (9) in order to eliminate
any partial derivatives with respect to x. The result is the following equation

∂2f ∂ $ ∂f 1 ∂f 1 sin(φ) ∂f %
= sin(θ) cos(φ) sin(θ) cos(φ) + cos(θ) cos(φ) − +
∂x2 ∂r ∂r r ∂θ r sin(θ) ∂φ
1 ∂ $ ∂f 1 ∂f 1 sin(φ) ∂f %
cos(θ) cos(φ) sin(θ) cos(φ) + cos(θ) cos(φ) − −
r ∂θ ∂r r ∂θ r sin(θ) ∂φ
1 sin(φ) ∂ $ ∂f 1 ∂f 1 sin(φ) ∂f %
sin(θ) cos(φ) + cos(θ) cos(φ) − .
r sin(θ) ∂φ ∂r r ∂θ r sin(θ) ∂φ

In the hopes of simplifying the above equation, we operate the derivates on the
operands and get

∂2f $ ∂2f 1 ∂f 1 ∂2f


= sin(θ) cos(φ) sin(θ) cos(φ) 2 − 2 cos(θ) cos(φ) + cos(θ) cos(φ) +
∂x2 ∂r r ∂θ r ∂r∂θ
1 sin(φ) ∂f 1 sin(φ) ∂ 2 f % 1 $ ∂f
− + cos(θ) cos(φ) cos(θ) cos(φ) +
r2 sin(θ) ∂φ r sin(θ) ∂φ∂r r ∂r
∂2f 1 ∂f 1 ∂2f 1 sin(φ) cos(θ) ∂f
sin(θ) cos(φ) − sin(θ) cos(φ) + cos(θ) cos(φ) 2 + −
∂r∂θ r ∂θ r ∂θ r sin2 (θ) ∂φ
1 sin(φ) ∂ 2 f % 1 sin(φ) $ ∂f ∂2f
− − sin(θ) sin(φ) + sin(θ) cos(φ) −
r sin(θ) ∂θ∂φ r sin(θ) ∂r ∂r∂φ
1 ∂f 1 ∂2f 1 cos(φ) ∂f 1 sin(φ) ∂ 2 f %
cos(θ) sin(φ) + cos(θ) cos(φ) − − .
r ∂θ r ∂θ∂φ r sin(θ) ∂φ r sin(θ) ∂φ2

2
After further simplifying the above equation, we arrive at the following form

∂2f $ ∂2f 1 ∂f 1 ∂2f


= sin2 (θ)cos2 (φ) − 2 cos(θ) sin(θ)cos2 (φ) + cos(θ) sin(θ)cos2 (φ) +
∂x2 ∂r 2 r ∂θ r ∂r∂θ
1 ∂f 1 ∂2f % $ 1 2 ∂f
sin(φ) cos(φ) − sin(φ) cos(φ) + cos (θ)cos2 (φ) +
r2 ∂φ r ∂φ∂r r ∂r
1 ∂2f 1 ∂f 1 ∂2f
sin(θ) cos(θ)cos2 (φ) − 2 sin(θ) cos(θ)cos2 (φ) + 2 cos2 (θ)cos2 (φ) 2 +
r ∂r∂θ r ∂θ r ∂θ
1 sin(φ) cos(φ)cos2 (θ) ∂f 1 cos(θ) sin(φ) cos(φ) ∂ 2 f % $ 1 2 ∂f
− + sin (φ) −
r2 sin2 (θ) ∂φ r2 sin(θ) ∂θ∂φ r ∂r
1 ∂2f 1 cos(θ)sin2 (φ) ∂f 1 cos(θ) cos(φ) sin(φ) ∂ 2 f
sin(φ) cos(φ) + 2 − 2 +
r ∂r∂φ r sin(θ) ∂θ r sin(θ) ∂θ∂φ
1 sin(φ) cos(φ) ∂f 1 sin2 (φ) ∂ 2 f %
2 + 2 .
r 2
sin (θ) ∂φ r sin2 (θ) ∂φ2

Notice that we have derived the first term of the right-hand side of equation
2
(3) (i.e. ∂∂xf2 ) in terms of spherical coordinates. We now have to do a similar
2 2
arduous derivation for the rest of the two terms (i.e. ∂∂yf2 and ∂∂zf2 ). Lets do it!
After we substitute the values of (7) into equation (5) we get

∂f ∂f 1 ∂f 1 cos(φ) ∂f
= sin(θ) sin(φ) + cos(θ) sin(φ) + . (10)
∂y ∂r r ∂θ r sin(θ) ∂φ

Again, assuming that f is a sufficiently differentiable function, we can replace


f by ∂f
∂y in the above equation and arrive at the following

∂2f ∂ $ ∂f % 1 ∂ $ ∂f % 1 cos(φ) ∂ $ ∂f %
= sin(θ) sin(φ) + cos(θ) sin(φ) + (11).
∂y 2 ∂r ∂y r ∂θ ∂y r sin(θ) ∂φ ∂y

Now we substitute equation (10) into equation (11) in order to eliminate any
partial derivatives with respect to y. The result is the following

∂2f ∂ $ ∂f 1 ∂f 1 cos(φ) ∂f %
= sin(θ) sin(φ) sin(θ) sin(φ) + cos(θ) sin(φ) + +
∂y 2 ∂r ∂r r ∂θ r sin(θ) ∂φ
1 ∂ $ ∂f 1 ∂f 1 cos(φ) ∂f %
cos(θ) sin(φ) sin(θ) sin(φ) + cos(θ) sin(φ) + +
r ∂θ ∂r r ∂θ r sin(θ) ∂φ
1 cos(φ) ∂ $ ∂f 1 ∂f 1 cos(φ) ∂f %
sin(θ) sin(φ) + cos(θ) sin(φ) + .
r sin(θ) ∂φ ∂r r ∂θ r sin(θ) ∂φ

3
Now we operate the operators and get
∂2f $ ∂2f 1 ∂f 1 ∂2f
2
= sin(θ) sin(φ) sin(θ) sin(φ) 2 − 2 cos(θ) sin(φ) + cos(θ) sin(φ) −
∂y ∂r r ∂θ r ∂r∂θ
1 cos(φ) ∂f 1 cos(φ) ∂ 2 f % 1 $ ∂f
2
+ + cos(θ) sin(φ) sin(θ) sin(φ) +
r sin(θ) ∂φ r sin(θ) ∂r∂φ r ∂r∂θ
∂f 1 ∂f 1 ∂2f 1 cos(φ)cos(θ) ∂f
cos(θ) sin(φ) − sin(θ) sin(φ) + cos(θ) sin(φ) 2 − +
∂r r ∂θ r ∂θ r sin2 (θ) ∂φ
1 cos(φ) ∂ 2 f % 1 cos(φ) $ ∂f ∂2f
+ sin(θ) cos(φ) + sin(θ) sin(φ) +
r sin(θ) ∂θ∂φ r sin(θ) ∂r ∂r∂φ
1 ∂f 1 ∂2f 1 sin(φ) ∂f 1 cos(φ) ∂ 2 f %
cos(θ) cos(φ) + cos(θ) sin(φ) − + ,
r ∂θ r ∂θ∂φ r sin(θ) ∂φ r sin(θ) ∂φ2
and after some simplifications
∂2f $ ∂2f 1 ∂f 1 ∂2f
2
= sin2 (θ)sin2 (φ) 2 − 2 sin(θ) cos(θ)sin2 (φ) + sin(θ) cos(θ)sin2 (φ) −
∂y ∂r r ∂θ r ∂r∂θ
1 ∂f 1 ∂2f % $ 1 ∂f
2
sin(φ) cos(φ) + sin(φ) cos(φ) + cos(θ) sin(θ)sin2 (φ) +
r ∂φ r ∂r∂φ r ∂r∂θ
1 2 ∂f 1 ∂f 1 ∂2f
cos (θ)sin2 (φ) − 2 sin(θ) cos(θ)sin2 (φ) + 2 cos2 (θ)sin2 (φ) 2 −
r ∂r r ∂θ r ∂θ
1 sin(φ) cos(φ)cos2 (θ) ∂f 1 cos(θ) sin(φ) cos(φ) ∂ 2 f % $ 1 2 ∂f
+ + cos (φ) +
r2 sin2 (θ) ∂φ r2 sin(θ) ∂θ∂φ r ∂r
1 ∂2f 1 cos(θ)cos2 (φ) ∂f 1 cos(θ)cos(φ) sin(φ) ∂ 2 f
cos(φ) sin(φ) + 2 + 2 −
r ∂r∂φ r sin(θ) ∂θ r sin(θ) ∂θ∂φ
1 sin(φ) cos(φ) ∂f 1 cos2 (φ) ∂ 2 f %
2 + .
r2 sin (θ) ∂φ r2 sin2 (θ) ∂φ2
∂2f
Now its time to derive ∂z 2 . After our substitution of value in (7) into
equation (6) we get
∂f ∂f 1 ∂f
= cos(θ) − sin(θ) . (12)
∂z ∂r r ∂θ
Once more, assuming that f is a sufficiently differentiable function, we can
replace f by ∂f
∂z in the above equation which gives us the following

∂2f ∂ $ ∂f % 1 ∂ $ ∂f %
= cos(θ) − sin(θ) . (13)
∂z 2 ∂r ∂z r ∂θ ∂z
Now we substitute equation (12) into equation (13) in order to eliminate any
partial derivatives with respect to z and we arrive at
∂2f ∂ $ ∂f 1 ∂f %
= cos(θ) cos(θ) − sin(θ) −
∂z 2 ∂r ∂r r ∂θ
1 ∂ $ ∂f 1 ∂f %
sin(θ) cos(θ) − sin(θ) .
r ∂θ ∂r r ∂θ

4
After operating the operators we get

∂2f $ ∂2f 1 ∂f 1 ∂2f %


= cos(θ) cos(θ) 2 + 2 sin(θ) − sin(θ) −
∂z 2 ∂r r ∂θ r ∂r∂θ
1 $ ∂f ∂2f 1 ∂f
sin(θ) − sin(θ) + cos(θ) − cos(θ) −
r ∂r ∂r∂θ r ∂θ
2 %
1 ∂ f
sin(θ) 2 ,
r ∂θ
and then simplifying

∂2f $ ∂2f 1 ∂f 1 ∂ 2 f % $ 1 2 ∂f
= cos2 (θ) + cos(θ) sin(θ) − cos(θ) sin(θ) + sin (θ) −
∂z 2 ∂r2 r2 ∂θ r ∂r∂θ r ∂r
1 ∂2f 1 ∂f 1 ∂2f %
sin(θ) cos(θ) + 2 sin(θ) cos(θ) + 2 sin2 (θ) 2 .
r ∂r∂θ r ∂θ r ∂θ
Now that we have all three terms of the right hand side of equation (3)(i.e.
∂2f ∂2f 2
and ∂∂zf2 ), we add them all together (because of equation (3)) to get
∂x2 , ∂y 2

5
the laplacian in terms of r, θ and φ
$ ∂2f 1 ∂f 1 ∂2f
∇2 f = sin2 (θ)cos2 (φ) 2 − 2 cos(θ) sin(θ)cos2 (φ) + cos(θ) sin(θ)cos2 (φ) +
∂r r ∂θ r ∂r∂θ
1 ∂f 1 2
∂ f % $ 1 ∂f
2
sin(φ) cos(φ) − sin(φ) cos(φ) + cos2 (θ)cos2 (φ) +
r ∂φ r ∂φ∂r r ∂r
1 ∂2f 1 ∂f 1 ∂2f
sin(θ) cos(θ)cos2 (φ) − 2 sin(θ) cos(θ)cos2 (φ) + 2 cos2 (θ)cos2 (φ) 2 +
r ∂r∂θ r ∂θ r ∂θ
1 sin(φ) cos(φ)cos2 (θ) ∂f 1 cos(θ) sin(φ) cos(φ) ∂ 2 f % $ 1 2 ∂f
− + sin (φ) −
r2 sin2 (θ) ∂φ r2 sin(θ) ∂θ∂φ r ∂r
1 ∂2f 1 cos(θ)sin2 (φ) ∂f 1 cos(θ) cos(φ) sin(φ) ∂ 2 f
sin(φ) cos(φ) + 2 − 2 +
r ∂r∂φ r sin(θ) ∂θ r sin(θ) ∂θ∂φ
1 sin(φ) cos(φ) ∂f 1 sin2 (φ) ∂ 2 f % $ 2 2 ∂2f
+ + sin (θ)sin (φ) −
r2 sin2 (θ) ∂φ r2 sin2 (θ) ∂φ2 ∂r2
1 ∂f 1 ∂2f 1 ∂f
2
sin(θ) cos(θ)sin2 (φ) + sin(θ) cos(θ)sin2 (φ) − 2 sin(φ) cos(φ) +
r ∂θ r ∂r∂θ r ∂φ
1 ∂2f % $ 1 ∂f 1 ∂f
sin(φ) cos(φ) + cos(θ) sin(θ)sin2 (φ) + cos2 (θ)sin2 (φ) −
r ∂r∂φ r ∂r∂θ r ∂r
1 2 ∂f 1 2 2 ∂2f 1 sin(φ) cos(φ)cos2 (θ) ∂f
sin(θ) cos(θ)sin (φ) + cos (θ)sin (φ) − +
r2 ∂θ r2 ∂θ2 r2 sin2 (θ) ∂φ
1 cos(θ) sin(φ) cos(φ) ∂ 2 f % $ 1 2 ∂f 1 ∂2f
2
+ cos (φ) + cos(φ) sin(φ) +
r sin(θ) ∂θ∂φ r ∂r r ∂r∂φ
1 cos(θ)cos2 (φ) ∂f 1 cos(θ)cos(φ) sin(φ) ∂ 2 f 1 sin(φ) cos(φ) ∂f
+ 2 − 2 +
r 2 sin(θ) ∂θ r sin(θ) ∂θ∂φ r sin2 (θ) ∂φ
1 cos2 (φ) ∂ 2 f % $ 2 ∂ 2 f 1 ∂f 1 ∂2f %
2 2 2
+ cos (θ) 2 + 2 cos(θ) sin(θ) − cos(θ) sin(θ) +
r sin (θ) ∂φ ∂r r ∂θ r ∂r∂θ
$1 ∂f 1 ∂2f 1 ∂f 1 ∂2f %
sin2 (θ) − sin(θ) cos(θ) + 2 sin(θ) cos(θ) + 2 sin2 (θ) 2 .
r ∂r r ∂r∂θ r ∂θ r ∂θ
It may be hard to believe but the truth is that the above expression, after
some miraculous simplifications of course, reduces to the following succinct form
and we finally arrive at the Laplacian in spherical coordinates!
∂2f 1 ∂2f 1 1 ∂2f 2 ∂f 1 cos(θ) ∂f
∇2 f = + + + + 2 . (14)
∂r2 r2 ∂θ2 r2 sin2 (θ) ∂φ2 r ∂r r sin(θ) ∂θ

We can write the Laplacian in an even more compact form as2


1 ∂ $ 2 ∂f % 1 ∂ $ ∂f % 1 ∂2f
∇2 f = r + sin(θ) + . (15)
r2 ∂r ∂r r2 sin(θ) ∂θ ∂θ r2 sin2 (θ) ∂φ2

2 Readers might be surprised how I got from expression (14) to expression (15) so fast!

Even though it is true that expression (14) is equivalent to expression (15), I wouldn’t have
been able to write the expression (15) if I hadn’t known about it beforehand.

You might also like