0% found this document useful (0 votes)
126 views50 pages

SJ Alvst Andiga Arbeten I Matematik: Spherical Harmonics: A Theoretical and Graphical Study

The document discusses spherical harmonics and their properties. Spherical harmonics form an orthogonal basis that can be used to represent functions defined on the unit sphere, analogous to how sine and cosine functions represent functions on an interval. The document proves important theorems about representing functions as a series of spherical harmonics and derives explicit formulas for spherical harmonics in three dimensions.

Uploaded by

Sayantan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views50 pages

SJ Alvst Andiga Arbeten I Matematik: Spherical Harmonics: A Theoretical and Graphical Study

The document discusses spherical harmonics and their properties. Spherical harmonics form an orthogonal basis that can be used to represent functions defined on the unit sphere, analogous to how sine and cosine functions represent functions on an interval. The document proves important theorems about representing functions as a series of spherical harmonics and derives explicit formulas for spherical harmonics in three dimensions.

Uploaded by

Sayantan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

SJÄLVSTÄNDIGA ARBETEN I MATEMATIK

MATEMATISKA INSTITUTIONEN, STOCKHOLMS UNIVERSITET

Spherical harmonics: a theoretical and graphical study

av

Christian Helanow

2009 - No 8

MATEMATISKA INSTITUTIONEN, STOCKHOLMS UNIVERSITET, 10691 STOCKHOLM


Spherical harmonics: a theoretical and graphical study

Christian Helanow

Självständigt arbete i matematik 15 högskolepoäng, grundnivå

Handledare: Andreas Axelsson

2009
Abstract
The topic of harmonic polynomials is briefly discussed to show that
every polynomial on Rn can be decomposed into harmonic polynomials.
Using this property it is proved that every function that is square inte-
grable on the hypersphere can be represented by a series of spherical har-
monics (harmonic polynomials restricted to the hypersphere), and that
the series is converging with respect to the norm in this space. Explicit
formulas for these functions and series are calculated for three dimensional
euclidean space and used for graphical illustrations. By applying stereo-
graphic projection a way of graphically illustrating spherical harmonics in
the plane and how a given function is approximated by a sum of spherical
harmonics is presented.

1
Contents
1 Introduction 3

2 Harmonic polynomials 4
2.1 Definitions and notations . . . . . . . . . . . . . . . . . . . . . . 4
2.2 The orthogonal decomposition of polynomials . . . . . . . . . . . 4
2.3 The dimension of homogeneous harmonic polynomials . . . . . . 7
2.4 Spherical Harmonics . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Zonal Harmonics 12
3.1 Zonal Harmonics in the series expansion of a given function . . . 12
3.2 Properties of zonal harmonics . . . . . . . . . . . . . . . . . . . . 14

4 Spherical Harmonics in Spherical Coordinates 17


4.1 Eigenfunctions to Laplace’s equation . . . . . . . . . . . . . . . . 17
4.2 The Legendre Polynomial . . . . . . . . . . . . . . . . . . . . . . 18
4.3 Oscillations of the Zonal Harmonic . . . . . . . . . . . . . . . . . 21
4.4 Solutions to Legendre’s associated equation . . . . . . . . . . . . 22
4.5 Series of Spherical Harmonics . . . . . . . . . . . . . . . . . . . . 23

5 Graphical illustrations 27
5.1 Illustrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1.1 Legendre polynomials and Zonal Harmonics . . . . . . . . 28
5.1.2 Spherical Harmonics . . . . . . . . . . . . . . . . . . . . . 30
5.1.3 Approximation of functions in stereographic coordinates . 32

A Appendix A 40
A.1 The Laplace operator in Spherical Coordinates . . . . . . . . . . 40
A.1.1 The spherical Laplace operator in stereographic coordinates 41

B Appendix B 42

2
1 Introduction
From Fourier analysis it is known that an infinite set of orthogonal sine and
cosine functions span the space of square integrable functions on the interval
[−π, π]. By considering functions in n-dimensional space that solve Laplace’s
equation, a subclass of functions called spherical harmonics can be defined.
These functions can be shown to be an analogue to the sine and cosine functions
in the sense that spherical harmonics of different degrees form an orthogonal
basis that spans the space of functions that are square integrable on the sphere.
This study is meant to present some of the available information on spherical
harmonics in a way that appeals to a reader at the undergraduate level. The
main aim is to establish a clear connection between the special cases of Fourier
analysis in R2 and spherical harmonics in R3 , both by using theory and by
graphically illustrating the spherical harmonics in a number of ways.
Each section is structured around one or a few central results. These will
be introduced at the beginning of each section, in the form of a discussion or
as a stated theorem. After this is done, the tools needed to prove the relevant
theorems will be introduced. The purpose of this layout is to give the reader an
appreciation of the importance and consequences of the central theorems.
The first part of this study, presented in section 2 and 3, is concerned with
the general topic of harmonic polynomials and how these can be restricted to the
sphere to define spherical harmonics. Since this theoretical part is not greatly
facilitated by only considering three dimensional euclidean space, it will include
complex valued functions f (x) : Rn 7→ C. No explicit formulas for spheri-
cal harmonics are derived in this section, which can make it seem somewhat
abstract. It is recommended that the reader looks through the graphical illus-
trations at the end of this study to get an intuitive understanding of spherical
harmonics while reading the general theory. Later sections will take a more
formal approach to these illustrations. The main result of section 2 is the or-
thogonal decomposition of functions that are square integrable on the sphere
into spherical harmonics, which is presented in Theorem 2.6. In section 3 we
focus on a way to calculate the unique spherical harmonics that decompose a
given function, which is given by the formula in Theorem 3.2. However, as can
be seen in later sections that include explicit calculations, this formula is of
theoretical rather than practical value.
The second part (section 4) is theory applied to three dimensional euclidean
space. The emphasis in this section is on finding the solution to Laplace’s
equation in spherical coordinates. The answer results in an explicit expression
for spherical harmonics in three dimensions. In Theorem 4.4 it is summarized
how to find the expansion of a given function into spherical harmonics. We will
only consider the case of real-valued functions, thus finding formulas that can
be applied directly in the final section containing the illustrations.
The last part (section 5) graphically illustrates the theoretical concepts from
part two. Examples will be given of both traditional ways of doing this, as well
as less common ways (not found in literature during the research of this study).
To accomplish this, some theory about stereographic projection is presented.
The general disposition of section 2 and 3 are inspired heavily by [1, Chapter
5]. Some theorems have been added or chosen to be proved in a different way.
If so, their source will be referred to in the text. The idea to section 4 is from
[3, Chapter 10], [4] and [8].

3
2 Harmonic polynomials
2.1 Definitions and notations
In this study n will always denote a positive integer. A function f that is
square integrable on Rn is written as f ∈ L2 (Rn ). A function f (x) defined on
an open subset of Rn that is at least twice continuously differentiable and fulfills
Laplace’s equation (1)
∂2f ∂2f
2 + ··· + ≡ 0, (1)
∂x1 ∂x2n
is called harmonic. Defining the Laplacian operator ∆ as the sum of all the
second partial derivatives the above condition can be written as

∆f ≡ 0. (2)

Note that this definition applies to complex valued functions, since it would only
mean that the real and imaginary parts of f are both harmonic.
As is customary R denotes the real numbers and C the complex numbers.
If a function f is continuous on a given set K, this will be denoted f ∈ C(K).
The unit sphere is defined as the boundary of the unit ball, and denoted as S.
It is understood that if dealing with a subset of Rn , the surface that is the unit
sphere has dimension n − 1.

2.2 The orthogonal decomposition of polynomials


A polynomial p(x) on Rn is called homogeneous of degree k if for a constant
t it fulfills p(tx) = tk p(x). The space of polynomials that are homogeneous
of degree k will be denoted Pk (Rn ) and the subspace of Pk (Rn ) containing
those polynomials that are harmonic will be denoted Hk (Rn ). Note that every
Pk
polynomial P of degree k on Rn can be written as P = j=0 pj , where each
Pk
pj ∈ Pj (Rn ). Since ∆P = j=0 ∆pj , we have that P is harmonic if and only
if each pj ∈ Hj (Rn . Given this fact, this section will focus on the polynomials
pk ∈ Hk (Rn ).
The main result of this section is about the decomposition of homogeneous
polynomials. This is presented in the theorem below.

Theorem 2.1. If k ≥ 2, then

Pk (Rn ) = Hk (Rn ) ⊕ |x|2 Pk−2 (Rn ).

However, before proving the statement above, let us consider some impor-
tant consequences. Theorem 2.1 states that every homogeneous polynomial
p ∈ Pk (Rn ) can be decomposed in this way. Naturally this argument can be
transferred to a homogeneous polynomial q ∈ Pk−2 (Rn ). Extending this to
polynomials of lesser degree we get:

p = pk + |x|2 q, for some pk ∈ Hk (Rn ), q ∈ Pk−2 (Rn ),


q = pk−2 + |x|2 s, for some pk−2 ∈ Hk−2 (Rn ), s ∈ Pk−4 (Rn ),
..
.

4
This relation holds k2 times (or the largest integer less than this), leaving the
last term to contain either a polynomial of degree 1 or a constant. Substituting
the above relations stepwise leads us to a corollary to Theorem 2.1.
Corollary 2.2. Every p ∈ Pk (Rn ) can be uniquely written in the form
p = pk + |x|2 pk−2 + · · · + |x|2m pk−2m ,
k
where m denotes the largest integer less than or equal to 2 (that is k −2m equals
0 if k is even, 1 if k is odd) and pj ∈ Hj (Rn ).
Proof. The proof has already been outlined in the argument above. Noting that
Pk (Rn ) = Hk (Rn ) for k = 0, 1 , we see that the statement is true for these values
of k. For k ≥ 2, the proof is by induction assuming that the equality holds when
k is replaced by k − 2. This holds because of Theorem 2.1, giving the above
result.
For the uniqueness of the decomposition, assume that
pk + |x|2 qk−2 = p̃k + |x|2 q̃k−2 ,
where pk , p̃k ∈ Hk (Rn ) and qk−2 , q̃k−2 ∈ Pk−2 (Rn ). This is equivalent to
pk − p̃k = |x|2 q̃k−2 − |x|2 qk−2 .
Since the left hand side of the equation above is a harmonic polynomial, this
must also be true for the right hand side. But according to Theorem 2.1 the
right hand side does not belong to Hk (Rn ). Hence the only way the equality
can hold is if qk−2 − q̃k−2 = 0.
The importance of this corollary becomes apparent when considering poly-
nomials that are restricted to the sphere. In this special case Corollary 2.2
becomes the following statement.
Corollary 2.3. Any homogeneous polynomial p ∈ Pk (Rn ) restricted to the unit
sphere can be uniquely written on the form
p = pk + pk−2 + · · · + pk−2m ,
k
where m denotes the largest integer less than or equal to 2 (that is k −2m equals
0 if k is even, 1 if k is odd) and pj ∈ Hj (Rn ).
Proof. Just applying the fact that any power of the factor |x|2 = 1 on S to
Corollary 2.2, gives us the decomposition of p. We will only comment on the
uniqueness by observing that the decomposition is harmonic and is the (unique)
solution to the Dirichlet problem for the ball (see [1, p. 12]) when the boundary
data is the restriction of p to the sphere.
From our initial discussion about homogeneous polynomials we know that
Corollary 2.3 indirectly states that any polynomial on the sphere can be written
as a sum of unique harmonic homogeneous polynomials (on the sphere). Here
we have already hinted at the importance of Theorem 2.1 and that this leads to
a special reason to study harmonic polynomials on the sphere. Since this topic
will be more thoroughly discussed in section 2.4, we leave this special case for
now.
So far we have only stated Theorem 2.1. For the proof it will be necessary to
rely on some facts from linear algebra about the decomposition of dual spaces.
In particular the following about adjoint mappings is used ([5, p. 204]).

5
Adjoint mappings. Let E and F be inner product spaces. Then the linear map
ϕ : E 7→ F induces a map ϕ̃ : F 7→ E satisfying

hϕx, yi = hx, ϕ̃yi , (3)

where ϕ and ϕ̃ are said to be adjoint. By this relation F can be orthogonally


decomposed as
F = Im ϕ ⊕ ker ϕ̃. (4)

For a thorough discussion on the definitions and the linear algebra used, see
for instance [5, Chapter II]. We now prove Theorem 2.1 ([7, Theorem 4.1.1]).

Proof of Theorem 2.1. The goal of this proof is to find adjoint maps from Pk (Rn ) →
Pk−2 (Rn ) and Pk−2 (Rn ) → Pk (Rn ), such that equation (4) can be used to de-
termine the orthogonal decomposition of these spaces. To accomplish this an
inner product is defined to suit this specific purpose. To facilitate this process
we introduce multi-index notation at this point.
If x ∈ Rn and α = (α1 , α2 , . . . , αn ) we define

xα = xα1 α2 αn
1 x2 . . . xn ,
α! = α1 !α2 ! . . . αn !,
|α| = α1 + α2 + · · · + αn and
∂α ∂ ∂ ∂
= α2 . . . αn .
∂xα ∂xα 1
1
∂x 2 ∂xn

Any polynomial p(x) ∈ Pk (Rn ) can be written on the form


X
p(x) = cα xα , where |α| = k, and cα ∈ C.
α

∂α
an inner product on Pk (Rn ) can be
P
Using the operator p(D) = α cα ∂xα ,
defined as follows.

hp, qi = p(D)[q]
 
X ∂α  X
= cα α dβ xβ 
∂x
|α|=k |β|=k
X
= cα dβ δαβ α!,
|α|,|β|=k

where p, q ∈ Pk (Rn ), cα and dβ are (complex) constants and δαβ = 1 if α = β


and δαβ = 0 if α 6= β.
Now assume that p ∈ Pk (Rn ) is orthogonal to |x|2 Pk−2 (Rn ), so that |x|2 q, p =

6
0 for all q ∈ Pk−2 (Rn ). Then by the definition of the inner product we get

2
|x| q, p = (|x|2 q)(D)[p]
 
n 2 X α
X ∂ ∂
= 2 x2
cα α  (p)
j=1
∂ j ∂x

= ∆q(D)[p] = q(D)[∆p]
= q(D)[∆p] = hq, ∆pi = 0.

Since ∆p ∈ Pk−2 (Rn ), the calculation above indicates that ∆p is orthogonal to


every q ∈ Pk−2 (Rn ). This can only be true if ∆p ≡ 0, and therefore p ∈ Hk (Rn ).
Now consider the map

ϕ : Pk (Rn ) → Pk−2 (Rn ) such that p 7→ ∆p.

According to the above argument and equation (3) this has the adjoint map

ϕ̃ : Pk−2 (Rn ) → Pk (Rn ) such that q 7→ |x|2 q.

With Im ϕ̃ = {|x|2 q; q ∈ Pk−2 (Rn )} and ker ϕ = {p; p ∈ Hk (Rn )}, equation
(4) shows that
Pk (Rn ) = Hk (Rn ) ⊕ Pk−2 (Rn ).

Finally, note that the orthogonality in Theorem 2.1 implies that no polyno-
mial times the factor |x|2 is harmonic.

2.3 The dimension of homogeneous harmonic polynomials


This section is dedicated to finding dimHk (Rn ). We start by considering the
case n = 2. From complex analysis it is known that any polynomial p(z) =
a0 + a1 z + a2 z 2 ... (where a0 , a1 , a2 . . . are complex constants) can be written on
the complex form p(x, y) = u(x, y)+iv(x, y). Since every polynomial p(z) is ana-
lytic it follows that u(x, y) and v(x, y) are both harmonic functions. For a homo-
k k k
−ak z k
geneous polynomial of degree k we have that u = ak z +a 2
kz
and v = ak z 2i .
This indicates that both z k and z k are homogeneous harmonic polynomials.
Hence every homogeneous harmonic polynomial pk can be written as a complex
linear combination of {z k , z k }. From this we can see that dimHk (R2 ) = 2 for
all values of k ≥ 1. When k = 0 we have that p0 is a constant function and only
has dimension equal to one.
For n > 2, we note that Theorem 2.1 gives that the dimension of Hk (Rn )
is equal to dimPk (Rn ) minus dimPk−2 (Rn ). Hence all that is needed is to find
dimPk (Rn ). This can be accomplished through combinatorics, as is shown in
the proof of the proposition below. For the values k = 0, 1 every homogeneous
polynomial is harmonic, so we restrict our attention to k ≥ 2.
Proposition 2.4. If k ≥ 2, then
   
n n+k−1 n+k−3
dimHk (R ) = −
n−1 n−1

7
Proof. If we use the multi-index notation introduced in the proof of Theorem
2.1, we are looking for all the unique monomials

xα such that |α| = k.

This set of combinations can be seen as a basis for the space of homogeneous
polynomials of degree k, since every p ∈ Pk (Rn ) is a linear combination of these
elements.
In other words, we are asking the question “What is the number of unordered
selections, with repetition, of k objects from a set of n objects that can be made? “
([2, Theorem 11.2]). The answer is found in combinatorics and is
   
n+k−1 n+k−1
= .
k n−1
n+k−3
Hence the expression above equals dimPk (Rn ). Similarly dimPk−2 (Rn ) =

n−1 .
Since dimHk (Rn ) =dimPk (Rn )−dimPk−2 (Rn ), this finishes the proof.

We can easily calculate dimHk (Rn ) for n = 2, by using the formula from
Theorem 2.2.
   
k+1 k−1
dimHk (R2 ) = − = (k + 1) − (k − 1) = 2
1 1

for values of k ≥ 2. This confirms our previous argument that any p ∈ Hk (R2 ) is
in the complex linear span of {z k , z k }. For n = 3 a similar calculation show that
dimHk (R3 ) = 2k + 1, so the dimension of homogeneous harmonic polynomials
increase linearly with the degree. Further calculations can be made and will
reveal that if n = 4 the dimension will increase in a quadratic manner, if n = 5
in a cubic manner etc.
Now that we have discussed the basic properties of homogeneous harmonic
polynomials, we are ready to study what the results will be if these are restricted
to the sphere. This will be the main purpose of the next section, which contains
the general theory of spherical harmonics.

2.4 Spherical Harmonics


In section 2.2 we concluded that the restriction of harmonic polynomials to
the sphere resulted in important consequences, which motivates the following
definition.

Definition 2.5. A homogeneous harmonic polynomials of degree k on Rn re-


stricted to the unit sphere is called a spherical harmonic of degree k. The set of
spherical harmonics of degree k is denoted Hk (S n−1 ). If the situation permits,
the dimension of the sphere will be omitted and the set will be denoted Hk (S).

The aim of this section is to find an (infinite) orthogonal set of functions


that span the space L2 (S). That the set of spherical harmonics should be
such a set can be motivated by the following argument considering Fourier
analysis. Usually one thinks of a Fourier series as an expansion of a given

8
function f (x) ∈ L2 [−π, π] into trigonometric functions on the interval [−π, π].
This is usually written as

a0 X
f (x) = + (ak cos kx + bk sin kx),
2
k=1

where a0 , ak and bk are constants. However, from trigonometry we know that


the sine and cosine functions are functions defined on the unit circle, and that
iθ iθ
these can be written on exponential form as cos θ = e +e and sin θ = e −e
−iθ −iθ

2 2i
(where θ is the angle from the positive x-axis). This gives us the above Fourier
series in exponential form

X
f (x) = ck eikθ , (5)
k=−∞

where ck are complex constants that are directly related to ak and bk from
the ordinary Fourier series. From Parseval’s equation and Fourier analysis we
conclude that the (complex) linear span of {eikθ , e−ikθ }∞k=0 is dense in the space
of L2 [−π, π]([3], p. 191). But when θ ∈ [−π, π] the set {eikθ , e−ikθ }∞ k=0 is just
the restriction of {z k , z k }∞
k=0 to the one dimensional subspace that is the unit
circle.
Hence the Fourier series in equation (5) can be seen as an expansion into
spherical harmonics. Thus, in the special case n = 2, a Fourier expansion into
spherical harmonics and Parseval’s equation shows us that L2 (S) = ⊕∞ k=0 Hk (S).
This leads us to state the main theorem of this section.

Theorem 2.6. The infinite set {Hk (S)}k=0 is an orthogonal decomposition of
the space L2 (S) so that
L2 (S) = ⊕∞
k=0 Hk (S).

As has already been shown in Corollary 2.3, any polynomial restricted to


the sphere can be written as a sum of spherical harmonics. However, we want
to expand the concept of spherical harmonics being an orthogonal basis in the
space of polynomials restricted to the sphere to spherical harmonics being an
orthogonal basis in the space L2 (S), as is presented in Theorem 2.6. A theorem
of great importance in accomplishing this task is the Stone-Weierstrass theorem
(S-W). To get a first idea how this is done we will again think about the case of
Fourier analysis. The S-W for one variable is as follows ([11, Theorem 7.26]).
If f is a continuous complex function on [a, b], there exists a sequence of
polynomials Pn such that
lim Pn (x) = f (x)
n→∞

uniformly on [a, b].


Together with Corollary 2.3 and Parseval’s equation, the S-W results in
L2 [−π, π] = ⊕∞
k=0 Hk (S). An analogous result of the S-W holds in higher di-
mension ([11, Theorem 7.33]).
Stone-Weierstrass Theorem 2.7. Suppose A is a self-adjoint algebra of com-
plex continuous functions on a compact set K. If
• to every distinct pair of points x1 , x2 ∈ K, there corresponds a function
f ∈ A such that f (x1 ) 6= f (x2 ) (A separates points on K) and

9
• to each x ∈ K there corresponds a function g ∈ A such that g(x) 6= 0 (A
vanishes at no point of K),
then A is dense in C(K).
If we can confirm that the space of polynomials (A in S-W) restricted to the
sphere (K in S-W) fulfills the conditions in Theorem 2.7, we can say that these
are dense in the space of continuous functions restricted to the sphere.

• If Pk (S) is the complex vector space of homogeneous polynomials of de-


gree k restricted to the sphere, then any polynomial pk ∈ Pk (S) can be
written as its real and imaginary part pk = qk + isk where qk , sk ∈ Pk (S).
Hence pk = qk − isk also belongs to Pk (S) and the space of homogeneous
polynomials is self-adjoint. Since every polynomial can be decomposed
into a sum of homogeneous polynomials, this also applies to P(S).
• To show that P(S) separates any distinct points x, y ∈ S, x 6= y, consider
the set of functions {p|p = xk ; k = 0, 1 . . . n} where (x1 , x2 , . . . , xn ) is the
basis of Rn . If x, y vary with x1 , then by continuity p(x) 6= p(y). The
same argument holds for x2 , . . . , xn , so the space of polynomials separates
points.
• A function p = c constant on the sphere , where p ∈ P(S) and c 6= 0,
never vanishes.

Hence spherical harmonics are dense in C(S). To show the orthogonal decompo-
sition of the space L2 (S), we need to introduce an inner product. The (standard)
inner product of this space is defined by
Z
hf, gi = f g dσ, (6)
S

where σ denotes the normalized surface-area measure on S. To connect to the


case n = 2, consider the set of spherical harmonics {eikθ , e−ikθ }∞
k=0 that are
used in equation (5) for the Fourier series. Applying the inner product to these
gives Z π 

ikθ imθ dθ 1 if k = m
e ,e = ei(k−m)θ =
−π 2π 0 if k 6= m.
By this we can see that not only are the functions of the Fourier series dense
in L2 (S), but they are an orthogonal (even orthonormal) decomposition of that
space. To show that this also is true if n ≥ 2, we use a special case of Green’s
identity ([1, p. 79]) for the ball.
Z Z
(u∆v − v∆u) dV = (uDn v − vDn u) ds,
B S

where B is the unit ball, dV is the volume measure and ds is the surface measure.
Dn refers to differentiation with respect to the outwards unit normal, n. Note
that the left hand side of Green’s identity equals 0 if the two functions u, v are
harmonic. If Green’s identity is applied to p ∈ Hk (S) and q ∈ Hm (S), k 6= m
then we have Z
qDn p − pDn q dσ = 0.
S

10
When x ∈ S the vector n is only rx, where r = 1 on the unit sphere. So dif-
ferentiating with respect to r is the same as differentiating with respect to n.
Hence, because of the homogeneity of p,
d d k
(Dn p)(x) = p(rx) = (r p(x)) = krk−1 p(x) = kp(x).
dr dr
The same applies to q, and Green’s identity then gives us
Z
(k − m) pq dσ = 0. (7)
S

Since k 6= m we conclude that the integral in the equation above must equal
zero.
With the properties of Hk (S) that follow from the Stone-Weierstrass theorem
and Green’s identity we have enough to prove the main theorem of this section.
The conditions for the direct sum used in the proof of Theorem 2.6, come from
Hilbert space theory (which deals with euclidean spaces of infinite dimension,
as we are studying here). For the most part these conditions are quite intuitive,
and the theory behind them will not be discussed in detail.

Proof of Theorem 2.6. The conditions that must hold for Theorem 2.6 to be
true are:

1. Hk (S) is a closed subspace of L2 (S) for every k,

2. Hk (S) is orthogonal to every Hm (S), if k 6= m and


S∞
3. k=0 Hk (S) is dense in L2 (S).
Because Hk (S) is finite dimensional for every k, this space is closed. It also is
a subspace of L2 (S), therefore condition 1 holds. Condition 2 was showed to be
true in equation (7) by Green’s identity. Similarly condition 3 will hold
S∞because
the space of continuous functions C(S) is dense in L2 (S). That k=0 Hk is
dense in C(S) was a result of applying Theorem 2.7 to spherical harmonics.

Hence any function f ∈ L2 (S) can be expressed as an infinite sum of spherical


harmonics of different degrees. What remains to be shown is which specific
spherical harmonics are included in this sum when the function f is given.

11
3 Zonal Harmonics
3.1 Zonal Harmonics in the series expansion of a given
function
We will now try to find an analogue in Rn to what the Fourier coefficients are
in R2 . That there exists a unique series of spherical harmonics for any given
function f ∈ L2 (S) is clear from Theorem 2.6. Hence

X
f= pk where pk ∈ Hk (S). (8)
k=0

In a Fourier series, we have a big advantage compared to when n > 2, namely


we know that an explicit orthogonal basis for Hk (S) is {eikθ , e−ikθ }, and that
this is valid for all k. Thus only two operations are needed in order to determine
the unique Fourier coefficients Ak , Bk that specify pk as a linear combination
in these bases. If we would try to extend this concept to n > 2, two immediate
problems emerge. First, nothing in our study so far indicates that there is
an obvious basis for Hk (Rn ) that we could use to determine the coefficients.
Secondly, just considering the case of n = 3 where dimHk (S) = 2k + 1, the
amount of calculations necessarily increases with k (in section 4.5 we will see
that this leads to a double summation).
From the above discussion we ideally need a function that determines pk ,
but so that the function itself should be independent of the choice of basis of
Hk (S). To find such a function, consider a fixed point x ∈ S and the linear map
ϕ : Hk (S) → C defined by ϕ(pk ) = pk (x). This linear map has the property
we are looking for. Using the inner product defined in equation (6), we define a
spherical harmonic with the property that fulfills the map ϕ (we wait by showing
its existence until later in the section).
Definition 3.1. For a fixed point x ∈ S, the zonal harmonic of degree k with
pole x, Zk (·, x), is defined to be the unique spherical harmonic that fulfills the
reproducing property
Z
pk (x) = hpk , Zk (·, x)i = pk (y)Zk (y, x) dσ(y). (9)
S

With the zonal harmonic, we can state the main result of this section, which
presents a way to calculate the spherical harmonics of the series expansion in
equation (8).
Theorem 3.2. If f ∈ L2 (S) and

X
f (x) = pk (x) where pk ∈ Hk (S),
k=0

then each pk is calculated by

pk (x) = hf, Zk (·, x)i .

Since the proof of the above theorem follows almost directly form the defi-
nition of zonal harmonics, we state it here.

12
Proof. If f ∈ L2 (S), then according to Theorem 2.6 f can be written as

X
f (y) = pi (y) where pi ∈ Hk (S).
i=0

We use the reproducing property of zonal harmonics and the orthogonality of


spherical harmonics to get
*∞ +
X
hf (y), Zk (y, x)i = pi (y), Zk (y, x)
i=0

X
= hpi (y), Zk (y, x)i = pk (x).
i=0

To show that the spherical


P∞ harmonic pk (x) is uniquely determined by f , consider
an expansion of f = j=0 qj for some qj ∈ Hj (S). Then we have that
*∞ +
X
pk (x) = hf, Zk (·, x)i = qj , Zk (·, x) = qk (x).
j=0

Hence the expansion stated in Theorem (3.2) is true and unique.

What remains to be proved is the existence of the zonal harmonic used in


the proof of Theorem 3.2. This is done with the aid of a theorem from Hilbert
space theory that is stated below. The theorem is modified from [10, Theorem
4.4] for the purpose here, but the original theorem applies to general Hilbert
spaces.

Riesz Representation Theorem 3.3. Let H be a finite Hilbert space and


consider the linear map ϕ : H → C. Then there exists a unique z ∈ H such that
ϕ(p) = hp, zi for all p ∈ H.

If we set the finite Hilbert space H to be Hk (S), p to be pk ∈ Hk (S) and the


unique element z to be Zk (·, x) ∈ Hk (S), applying Theorem 3.3 with the inner
product defined in equation (6) gives the relation in Definition 3.1.
Let us try to reconnect to Fourier analysis by calculating what the zonal
harmonic is when n = 2. From our argument following equation (5), we know
that any spherical harmonic of degree k is a linear combination of {eikθ , e−ikθ }.
So for a fixed point eiϕ ∈ S we can write Zk (eiθ , eiϕ ) = aeikθ + be−ikθ where
a, b are constants. The relation in Definition (3.1) gives


Z
−ikϕ
ceikϕ
+ de = (ceikθ + de−ikθ )(ae−ikθ + beikθ )
0 2π
= ac + bd

for all c, d. Hence it must be that

a = e−ikϕ
b = eikϕ

13
which gives

Zk (eiθ , eiϕ ) = eik(θ−ϕ) + eik(ϕ−θ) = 2 cos k(θ − ϕ).

When k = 0 this reduces to Z0 = 1. By assuming that the function f is


represented by the series in equation (8), we can check by calculation that


Z
hf, 2 cos k(θ − ϕ)i = 2Ak cos kθ cos k(θ − ϕ)
0 2π


Z
+ 2Bk sin kθ cos k(θ − ϕ)
0 2π
= Ak cos kϕ + Bk sin kϕ,
1
where the factor 2π comes from the standard measure on the circle. This shows
that when n = 2, Theorem 3.2 is the ordinary Fourier series. Hence, using
the zonal harmonic does not specifically calculate the coefficients Ak and Bk ,
but provides us with a way to determine pk as a whole. So we have reduced
the number of necessary operations from two to one. Similarly, using zonal
harmonics when n > 2 reduces theses operations from dimHk (S) for each k to
one.
Later in our study (section 4.2) we will calculate the explicit formula for a
fixed x ∈ S for the zonal harmonic when n = 3. This will be an essential step
in finding a formula for spherical harmonics in R3 .

3.2 Properties of zonal harmonics


Zonal harmonics possess some special properties. Only a few of these will be
necessary for our calculations in the upcoming sections, so we limit our focus to
the relevant characteristics. To prove Proposition 3.5 stated below, we will need
a property of harmonic functions, namely the rotational invariance of harmonic
functions. We denote the set of orthogonal (orthonormal) transformations as
O(n) and state the following lemma.

Lemma 3.4. Let T ∈ O(n). Then f is a harmonic if and only if (f ◦ T ) is


harmonic.

Proof. We outline this proof by using the mean-value property of harmonic


functions (see [1, Theorem 1.4]). This states that if f is harmonic on the closed
ball B(a, r) (closed ball centered at the point a with radius r), then f (a) equals
the average of f over the closure of B(a, r). Since the closure of B(a, r) is a
sphere of radius r and the mean over spheres does not change with rotation,
(f ◦ T ) is harmonic. Since T −1 ∈ O(n), the converse is also true.

Proposition 3.5. Suppose x, y ∈ S, T ∈ O(n) and k ≥ 0, then

1. Zk is real valued,

2. Zk (y, T (x)) = Zk (T −1 (y), x),

3. Zk (x, x) = dimHk (S) and

4. |Zk (y, x)| ≤ dimHk (S).

14
Proof. To prove property 1, we assume that pk ∈ Hk (S) and is real valued. This
gives that

0 = Im pk (x)
Z
= Im pk (y)Zk (y, x) dσ(y).
S

Now if we define pk (y) = ImZk (y, x), then the above statement implies that
Z
(ImZk (y, x))2 dσ(y) = 0,
S

which, because of the inner product defined, gives that ImZk (y, x) = 0.
To prove property 2, note that it applies for all pk ∈ Hk that

pk (T (x)) = (pk ◦ T )(x)


Z Z
= pk (T (y))Zk (y, x) dσ(y) = pk (y)Zk (T −1 (y), x) dσ(y).
S S

The last equality is due to the rotational invariance property of both the spher-
ical harmonics and the standard surface measure σ. On the other hand we can
also write
Z
pk (T (x)) = pk (y)Zk (y, T (x)) dσ(y).
S
Thus Z Z
pk (y)Zk (y, T (x)) dσ(y) = pk (y)Zk (T −1 (y), x) dσ(y).
S S
Due to the uniqueness of zonal harmonics asserted by Theorem 3.3, we conclude
that property 2 is true.
For property 3, let e1 , . . . , ehk be an orthonormal basis of Hk (S). Then the
linear combination of Zk (·, x) in this basis is
j=h
Xk j=h
Xk
Zk (·, x) = hZk (·, x), ej i ej = ej (x)ej ,
j=1 j=1

where the last equality is due to the reproducing property of zonal harmonics.
Hence we have that
j=h
Xk j=h
Xk
Zk (x, x) = ej (x)ej (x) = |ej (x)|2 .
j=1 j=1

By property 2 we have that Zk (T (x), T (x)) = Zk (x, x), so that the function
x 7→ Zk (x, x) is constant on S. Integrating the equation above over the sphere
and using the orthonormal properties of the basis gives that
 
Z Z j=h
Xk
Zk (x, x) = Zk (x, x) =  |ej (x)|2  dσ(x) = hk = dimHk .
S S j=1

15
To prove property 4, note that property 3 and the reproducing property of zonal
harmonics give that

||Zk (·, x)||22 = hZk (·, x), Zk (·, x)i = Zk (x, x) = dimHk ,

where || ||2 denotes the norm in L2 (S). Using the Cauchy-Schwarz inequality
we get that

|Zk (y, x)| = | hZk (·, x), Zk (·, y)i | ≤ ||Zk (·, x)||2 ||Zk (·, y)||2 = dimHk .

Note that a direct consequence of Proposition 3.5 is that zonal harmonics


are constant on the intersection of S and hyperplanes perpendicular to the pole
vector. That is, the value of a zonal harmonic in a given point x ∈ S depends
only on the distance of x to the pole. This is the explanation to the name they
have been given. To see that this is true, let T ∈ O(n) be T (x) = x. Hence a
function f is dependent only on the distance from x if and only if it satisfies the
relation f ◦ T −1 = f (and f ◦ T = f ). From Proposition 3.5 we can see that for
these types of T applied to zonal harmonics, it gives that

Zk (y, x) = Zk (y, T (x)) = Zk (T −1 (y), x).

The last property, which we here will only comment on, is that any spherical
harmonic possessing the properties of a zonal harmonic, must be a zonal har-
monic times a scalar constant. For a detailed discussion of this topic see [1, p.
101 -103].
We have now with Theorem 3.2 accomplished what we set out to do. We have
shown that the concept of Fourier analysis can be extended to n-dimensional
space with spherical harmonics playing the role of the infinite set of orthogonal
functions and zonal harmonics as the tool to determine what specific spherical
harmonics are to be used in a series expansion. The remainder of this study
will focus on developing explicit formulas for spherical and zonal harmonics and
applying these in a series in the special case when n = 3. In section 5 we
illustrate these functions graphically in different ways to develop an intuitive
understanding of the theoretical concepts from the previous sections.

16
4 Spherical Harmonics in Spherical Coordinates
4.1 Eigenfunctions to Laplace’s equation
In this section we will be performing direct calculations, so it is only natural
to find a suitable coordinate system. Applying the theory from the previous
sections to real-valued functions will lead to expressions of spherical and zonal
harmonics in the spherical coordinate system.
Consider a harmonic polynomial p(x, y, z) ∈ Hk (R3 ). A change of variables
x = r sin θ cos ϕ, y = r sin θ sin ϕ, z = r cos θ
where
r is the radius of the sphere,
ϕ is the angle from the positive x-axis to the projection in the xy-plane,
θ is the angle from the positive z-axis,
gives the polynomial p(r, ϕ, θ) in spherical coordinates. Because p(x, y, z) is
homogeneous of degree k, it is possible to factor out rk so that p(x, y, z) →
p(r, ϕ, θ) = rk f (ϕ, θ). By applying the laplacian for spherical coordinates (for
a derivation, see Appendix A.1),
∂2
   
1 ∂ ∂ 1 1 ∂ ∂
∆= 2 r2 + 2 2 + sin θ , (10)
r ∂r ∂r r sin θ ∂ϕ2 r2 sin θ ∂θ ∂θ
to p(r, ϕ, θ) we obtain the relation (11).
∂ 2 p 2 ∂p 1
∆p = + + 2 ∆s p = 0, (11)
∂r2 r ∂r r
where ∆s is the spherical Laplace operator defined as
1 ∂2
 
1 ∂ ∂
∆s = sin θ + .
sin θ ∂θ ∂θ sin2 θ ∂ϕ2
The partial derivatives of p(r, ϕ, θ) with respect to r can be calculated to be
∂p k
= krk−1 f (ϕ, θ) = p and
∂r r
∂2p k(k − 1)
= k(k − 1)rk−2 f (ϕ, θ) = p.
∂r2 r2
Inserting the expressions of the partial derivatives into equation (11) gives
k(k + 1)p + ∆s p = 0. (12)
Since the spherical Laplace operator ∆s does not act in the variable r, we can
divide equation (12) by rk resulting in the expression for spherical harmonics
k(k + 1)f (ϕ, θ) + ∆s f (ϕ, θ) = 0. (13)
Equation (13) is a partial differential equation that can be solved by separation
of variables. Let f (ϕ, θ) = Φ(ϕ)Θ(θ). If equation (13) is divided by f = ΦΘ we
get
∆s (ΦΘ)
k(k + 1) + = 0.
ΦΘ

17
From the above relation we can see that spherical harmonics are the eigenfunc-
tions to the spherical Laplace operator ∆s . Inserting the full expression for ∆s
and simplifying we get that

∂2Φ
 
1 ∂ ∂Θ 1
k(k + 1) + sin θ + 2 = 0. (14)
sin θΘ ∂θ ∂θ Φ sin θ ∂ϕ2
Equation (14) suggests that its last term is dependent only on the variable θ.
Therefore it holds that
1 ∂2Φ
= −n2 , (15)
Φ ∂ϕ2
where n is a positive constant. By standard tools for solving ordinary differential
equations, the solution to equation (15) is

Φ = A cos nϕ + B sin nϕ where A and B are real constants.

Note that if Φ would be complex valued n would not need to be positive for
Φ to be periodic, since with A, B ∈ C the solution to Φ(ϕ) could be written
as a complex linear combination of einϕ and e−inϕ . Inserting the expression in
equation (15) into equation (14) and multiplying by Θ results in

n2
   
1 ∂ ∂Θ
sin θ + k(k + 1) − Θ = 0. (16)
sin θ ∂θ ∂θ sin2 θ
If the function Θ is assumed to solve equation (16), then the solution to equation
(13) are functions of the kind

f (ϕ, θ) = (A cos nϕ + B sin nϕ) Θ, (17)

which are spherical harmonics of degree k. Combining this with the facts that
p(r, ϕ, θ) = rk f (ϕ, θ) and f = ΦΘ gives us the harmonic polynomials

p(r, ϕ, θ) = rk (A cos nϕ + B sin nϕ) Θ.

For further calculations it is convenient to make a change of a variable. If


z = cos θ and y(z) = Θ(θ), we can write equation (16)

n2
 
2 ′′ ′
(1 − z )y (z) − 2zy (z) + k(k + 1) − y(z) = 0. (18)
1 − z2

Equation (18) is called Legendre’s associated equation and the solutions to this
will be the topic of the next section.

4.2 The Legendre Polynomial


We start our search of solutions to equation (18) with the simplified special case
of n = 0, which then becomes

(1 − z 2 )y ′′ (z) − 2zy ′ (z) + k(k + 1)y(z) = 0. (19)

When n = 0 in equation (17), the spherical harmonic reduces to f (ϕ, θ) = AΘ.


From the discussion in section 3 we know that this solution can only be a zonal
harmonic times some real constant. Hence we derive a formula for Zk (S) in

18
R3 . Equation (19) is well known in the field of ordinary differential equations
and special functions and is known as Legendre’s equation. The solution to
Legendre’s equation is here only outlined, but a more extensive discussion can
be found in for instance [3, Ch. 10].
ODE theory tells us that z = 0 is an ordinary point of equation (19). This
means that we should seek a series solution to Legendre’s equation in the form

X
y= aj z j .
j=0

Differentiating this series term by term, and plugging the series expressions of
y, y ′ and y ′′ into equation (19) gives a recurrence relation between aj and aj+2

j(j + 1) − k(k + 1)
aj+2 = aj . (20)
(j + 2)(j + 1)

The important thing to note about the recurrence relation in (20) is that when
j = k, the coefficients ak+2 = ak+4 = ak+6 = · · · = 0. Hence one of the
independent solutions will always be a polynomial of degree k (with only even
or odd powers of z, depending on the value of k), while the other is an infinite
series. The polynomial solution is called the Legendre polynomial of degree k
and will be denoted Pk (z). The series solution is named the Legendre function
of the second kind, and denoted Qk (z). By applying the Cauchy ratio test to
the recurrence relation in (20) it can be shown that this series converges for
−1 < z < 1, however it diverges for |z| ≥ 1. This can be seen by observing  that

1+z
the series converges to a function for a specific k. For instance Q0 = 12 ln 1−z ,
which diverges at the points z = ±1 ([6, p. 710]). Since spherical harmonics
are defined on the whole sphere, the solution that we seek must be continuous
on the closed interval cos θ = z ∈ [−1, 1]. By the continuity of polynomials, the
Legendre polynomial is continuous for z ∈ [−1, 1]. Hence we focus on Pk (z) to
be the solution. We now try to find a formula for Pk (z).
The recurrence relation
(j + 2)(j + 1)
aj = − aj+2
(k − j)(k + j + 1)

follows directly from (20). If we start with the value j + 2 = k, and use the
above formula i times (where i is a positive integer), we can find the following
expression

(−1)i k(k − 1) · · · (k − 2i + 1)
ak−2i = i
· ak . (21)
2 i! (2k − 1)(2k − 3) · · · (2k − 2i + 1)

To complete the polynomial expression we still have to decide the value of a0


(or a1 ). A normalization value of a0 is chosen so that the k:th coefficient in
Pk (z) has the value ak = 2k(2k)!
(k!)2
. This is specially chosen so that Pk (1) = 1 for
all k. If this is inserted into equation (21) we get that

1 (−1)i (2k − 2i)!


ak−2i = k
· · .
2 i! (k − 2i)!(k − i)!

19
k (k−1)
It follows that if k is even the Legendre polynomial has 2 terms, or 2 if k
is odd. This gives the sum
m
1 X (−1)i (2k − 2i)!
Pk (z) = k
· z k−2i , k = 0, 1, 2 . . . , (22)
2 i=0 i! (k − 2i)!(k − i)!

where 
k/2 if k is even,
m=
(k − 1)/2 if k is odd.
We know from section 3 that Pk (z) times some constant c is a zonal harmonic
and that this set of polynomials is orthogonal. From the variable change z =
cos θ we can see that this particular zonal harmonic has its pole in the point
(x, y, z) = (0, 0, 1). Using the notation for the unit vector in the z-axis direction
ẑ we can write Zk (θ, ẑ) = cPk (cos θ). The following proposition shows the
relation between the zonal harmonic and its corresponding Legendre polynomial.

Proposition 4.1. Let Pk (cos θ) be a Legendre polynomial of degree k with pole


ẑ. Then

1. Zk (θ, ẑ) = (2k + 1)Pk (cos θ),


R1 2
2. −1 [Pk (z)]2 dz = 2k+1 .
Proof. For 1, note that the coefficient a0 in the Legendre polynomial is chosen so
that Pk (1) = 1. Since z = cos θ = 1 at the pole ẑ, we can see from Proposition
3.5 that
Zk (ẑ, ẑ) = dimHk (S) = cPk (1).
Together with Proposition 2.4 this gives that

c = dimHk (S) = 2k + 1,

which proves 1.
To prove 2, we again use Proposition 3.5 together with the result above.

||Zk (·, ẑ)||22 = hZk (·, ẑ), Zk (·, ẑ)i = h(2k + 1)Pk (z), (2k + 1)Pk (z)i
Z 2π Z 1
= [(2k + 1)Pk (z)]2 dσ(z)dσ(ϕ) = 2k + 1,
0 −1

where the last equality holds since dimHk (S) = 2k + 1. The last line in the
equation above indicates that
Z 1
d(z)
[(2k + 1)Pk (z)]2 = 2k + 1,
−1 2

which gives that


1
2
Z
[Pk (z)]2 dz = .
−1 2k + 1
This completes the proof.

20
Calculating the first few Legendre polynomials shows that
P0 (z) = 1, P1 (z) = z
P2 (z) = 12 (3z 2 − 1), P3 (z) = 12 (5z 3 − 3z),
P4 (z) = 18 (35z 4 − 30z 2 + 3), P5 (z) = 18 (63z 5 − 70z 3 + 15z).

From Proposition 4.1 we know that the Legendre polynomials are zonal har-
monics times a constant. Hence we have that Pk (z) ∈ Hk (S). However, if we
consider a Legendre polynomial, for instance P5 (z),
1
P5 (x, y, z) = (63z 5 − 70z 3 + 15z),
8
this polynomials does not look to be either homogeneous of degree 5 or harmonic.
By observing that if a function is restricted to the unit sphere any power of
(x2 + y 2 + z 2 ) is equal to one, we can expand P5 (z) as follows
1
P5 (x, y, z) = (63z 5 − 70z 3 (x2 + y 2 + z 2 ) + 15z(x2 + y 2 + z 2 )2 ).
8
This indeed is a homogeneous harmonic polynomial of degree 5, so P5 (x, y, z) ∈
H5 (S) which was to be expected from the previous theoretical discussion.

4.3 Oscillations of the Zonal Harmonic


By the properties of polynomials we expect Pk (z) to have k roots. Before we
present a proposition about the oscillatory behavior of Legendre polynomials
(from [9, Theorem 2.1.2]), we note that the set {Pk (z)}nk=0 is a basis for the space
of polynomials up to degree n. To see this, assume that the previous statement
is not true. Then there exists a linear combination such that for some 0 ≤ k ≤ n,
Pk (z) = a0 P0 (z) + a1 P1 (z) + · · · + ak−1 Pk−1 (z) + ak+1 Pk+1 (z) · · · + an Pn (z),
where aj ∈ R for 0 ≤ j ≤ n, j 6= k. The orthogonality of Legendre polynomials
gives that
Z 1 Z 1 k−1
X Z 1 n
X
[Pk (z)]2 dz = Pk (z)Pj (z) dz + Pk (z)Pj (z) dz = 0,
−1 −1 j=0 −1 j=k+1

which can not be true according to Proposition 4.1. An immediate consequence


is that any polynomial p ∈ Pk−1 (R), where Pk−1 (R) denotes the space of real-
valued polynomials of degree less than or equal to k − 1, is orthogonal to the
Legendre polynomial Pk (z) on the interval [−1, 1].
Proposition 4.2. Let Pk (z) be as in equation (22). Then the zeros of Pk (z)
are real, distinct and occur k times on the interval (−1, 1). Furthermore, the
zeros are symmetric around z = 0, and if k is an odd integer, z = 0 is a zero
itself.
Proof. By the orthogonality of Legendre polynomials we can see that
Z 1 Z 1
P0 (z)Pk (z) dz = Pk (z) dz = 0,
−1 −1

which implies that Pk (z) has at least one zero in the interval (−1, 1). To see
that the zeros in this interval are distinct, assume that z = z1 is a multiple zero.

21
Pk (z)
In this case it follows that (z−z1 )2 ∈ Pk−2 (R), which is orthogonal to Pk (z).
This gives that
1 1  2
Pk (z) Pk (z)
Z Z
0= Pk (z) dz = dz.
−1 (z − z1 )2 −1 (z − z1 )

Since the last the expression in the last integral is greater or equal to zero on
[−1, 1], the above equation is a contradiction. If we assume that Pk (z) has j ≥ 1
distinct zeros in (−1, 1) and that j < k we have that

Pk (z) = (z − z1 )(z − z2 ) . . . (z − zj )p(z) = q(z)p(z),

where p(z) is a polynomial of constant sign on (−1, 1) and q(z) ∈ Pj (R). Using
the orthogonality of q(z) and Pk (z) we get that
Z 1 Z 1
0= q(z)Pk (z) dz = [q(z)]2 p(z) dz.
−1 −1

This can not be true, since the expression [q(z)]2 p(z) has constant sign on
(−1, 1). This gives that j = k and p(x) = 1.

The relation between the Legendre polynomials and zonal harmonics and
the above theorem tells us that Zk (·, ẑ) vanishes on k circles perpendicular to
the z-axis.

4.4 Solutions to Legendre’s associated equation


We have seen that the special case of n = 0 gives a formula for zonal harmonics.
Now we attempt to find a solution to equation (18) for n ≥ 0. If this can be
accomplished, we have found the formula for spherical harmonics.
The approach of finding a solution is somewhat experimental in nature. The
general idea is that a relation between Legendre’s associated equation (18) and
Legendre’s equation (19) can be found by differentiating the latter n times. We
start by trying to find a closed formula for the n:th derivative of Legendre’s
2
equation. By the usual notation dy ′ d y ′′
dz is y , dz 2 is y and so on.

d2 y ′ dy ′
(1 − z 2 ) − 2 · 2z + (k(k + 1) − 2) y ′ = 0 first derivative,
dz 2 dz
d2 y ′′ dy ′′
(1 − z 2 ) 2 − 2 · 3z + (k(k + 1) − 2(1 + 2)) y ′′ = 0 second derivative,
dz dz
d2 y ′′′ dy ′′′
(1 − z 2 ) 2
− 2 · 4z + (k(k + 1) − 2(1 + 2 + 3)) y ′′′ = 0 third derivative.
dz dz
Continuing this process gives the general formula for differentiating n times.

d2 y (n) dy (n)
(1−z 2 ) −2(n+1)z +(k(k + 1) − n(n + 1)) y (n) = 0 n:th derivative.
dz 2 dz
(23)
Since we know that Pk (z) solves Legendre’s equation, a solution to equation
n
Pk (z)
(23) is the n:th derivative of this function, d dz n .

22
n
If we make the substitution y = (1−z 2 ) 2 u in Legendre’s associated equation
(18) we get
d2 u du
(1 − z 2 ) 2
− 2 · 2z + (k − n)(k + n + 1)u = 0.
dz dz
This equation is the same as the the relation arrived at in equation (23) with u
instead of y (n) . By the substitution made and relation just mentioned we can
conclude that a solution to Legendre’s associated equation (18) is
n dn Pk (z)
Pkn (z) = (1 − z 2 ) 2 . (24)
dz n
n
Qk (z)
In a similar way it can be shown that (1 − z 2 ) 2 d dz
n
n is the other solution to
n
equation (18), independent of Pk (z). However, the series solution is not of any
particular interest when deriving an expression for spherical harmonics. Pkn (z)
is called the associated Legendre function of degree k and order n, and as will be
shown in the coming section, this function will be important when expanding a
function f ∈ L2 (S) into a series of spherical harmonics.

4.5 Series of Spherical Harmonics


From equation (17), we see that we can write a general expression for a spherical
harmonic as a function of z and ϕ, and that this solves equation (13).
Definition 4.3. The general solution to Laplace’s equation that takes the form
n dn Pk (z)
Ỹkn (ϕ, z) = (A cos nϕ + B sin nϕ) (1 − z 2 ) 2 , (25)
dz n
where A and B are real constants, z = cos θ and 0 ≤ n ≤ k, is called a spherical
harmonic of degree k and order n.
We can see that there are 2k + 1 types of spherical harmonics of degree k,
n n P (z) n n P (z)
since there are two types (sin nϕ(1 − z 2 ) 2 d dzk
n and cos nϕ(1 − z 2 ) 2 d dzk
n )
when 1 ≤ n ≤ k, and only one when n = 0 (the Legendre polynomial). This is
consistent with our result for dimHk (S) from section 2.3.
From the theory covered in previous sections we know that Ỹkn is a homoge-
neous harmonic polynomial of degree k in the variables x, y and z. However, it
is not obvious that the expression given in Definition 4.3 is a polynomial. We
n
Pk (z)
know that d dz n is a polynomial in z, since this is just the n:th derivative of
the Legendre polynomial of degree k. Furthermore, since z = cos θ, we see that
the remaining part of the expression takes the form (A cos nϕ + B sin nϕ) sinn θ.
Focusing on the cosine part of this last expression (remembering that our initial
calculations restricted the function rk Ỹkn to the sphere), we multiply this by rn
to get
1h n n i
rn cos nϕ sinn θ = r sin θeiϕ + r sin θe−iϕ
2
1
= [(x + iy)n + (x − iy)n ] .
2
By the Binomial Theorem the last term in the above calculation is a (homoge-
neous) polynomial in x and y. A similar argument can be made for sin nϕ sinn θ.
This shows that the restriction of rk Ỹkn to the unit sphere is a polynomial.

23
From section 2.4 we know that any function f (z, ϕ) ∈ L2 (S) can be de-
veloped in an orthogonal series of spherical harmonics. For it to be possible
to express any spherical harmonic of degree k in the series, we need all the
2k + 1 spherical harmonics of degree k to be available. This leads to the double
summation in the series expansion of f , presented in the final theorem of this
study.

Theorem 4.4. Let f (θ, ϕ) ∈ L2 (S) be a real-valued function defined on the unit
sphere. Then f can be expressed as a series of spherical harmonics, such that

" n=k
#
X X
n n
f (θ, ϕ) = A0,k Pk (cos θ) + An,k cos nϕPk (cos θ) + Bn,k sin nϕPk (cos θ) ,
k=0 n=1

where
2π π
2k + 1
Z Z
A0,k = f (θ, ϕ) cos nϕPk (cos θ) sin θ dθ dϕ,
4π 0 0
2π π
2k + 1 (k − n)!
Z Z
An,k = f (θ, ϕ) cos nϕPkn (cos θ) sin θ dθ dϕ and
2π (k + n)! 0 0
2π π
2k + 1 (k − n)!
Z Z
Bn,k = f (θ, ϕ) sin nϕPkn (cos θ) sin θ dθ dϕ.
2π (k + n)! 0 0

Note that in the theorem above the substitution z = cos θ has been made,
resulting in Z 1 Z π
f (z) dz = f (θ) sin θ dθ.
−1 0

Before proving this theorem, we compare it to the main result of section 3


presented in Theorem 3.2. Applied to three dimensional space, this theorem
states that the spherical harmonic of degree k presented in Theorem 4.4 can be
calculated by the inner product of f (ϕ, θ) and the Legendre polynomial Pk (cos θ)
(the constant relating the Legendre polynomial to the zonal harmonic is here
omitted for readability). Hence the constants A0,k , An,k and Bn,k would not
have to be calculated. However, this would only calculate the series expansion
in a fixed point of the sphere, namely the pole of the Legendre polynomial. This
means that we would have to perform infinitely many operations if f is to be
expressed as a function with the pole (of Pk (cos θ)) as its variable. Comparing
this to Theorem 4.4, where 2k + 1 operations are necessary for each spherical
harmonic of degree k, the practical use of zonal harmonics to calculate the series
expansion of f is limited.
Before we can calculate the constants of the series in Theorem 4.4, we need
the orthogonality property of associated Legendre functions of different degrees.
This is presented in the proposition below.

Proposition 4.5. Let Pkn (z) and Pln (z) be the associated Legendre functions of
order n and degrees k and l respectively. Then
Z 1 (
0 if k 6= l,
Pkn (z)Pln (z) dz = 2 (k+n)!
−1 2k+1 (k−n)! if k = l.

24
Proof. By equation (24) and integration by parts we get
Z 1
dn Pl (z) dn Pk (z)
(1 − z 2 )n dz = (26)
−1 dz n dz n
Z 1 n−1  n

d Pl (z) d 2 n d Pk (z)
− · (1 − z ) dz.
−1 dz n−1 dz dz n
Inspired by the differentiation formula for associated Legendre functions, we
n−1
Pk (z)
substitute n by n − 1 in equation (23) (remember that d dzn−1 is a solution
to this equation) to get

dn+1 Pk (z) dn Pk (z) dn−1 Pk (z)


(1 − z 2 ) − 2nz + (k(k + 1) − n(n − 1)) = 0.
dz n+1 dz n dz n−1
Further, multiplying the above formula by (1 − z 2 )n−1 leads to

dn Pk (z) dn−1 Pk (z)


 
d
(1 − z 2 )n n
= −(k + n)(k − n + 1)(1 − z 2 )n−1 .
dz dz dz n−1
Inserting the above relation into equation (26) gives the reducing formula
Z 1
dn Pl (z) dn Pk (z)
(1 − z 2 )n dz =
−1 dz n dz n
Z 1
dn−1 Pl (z) dn−1 Pk (z)
− (k + n)(k − n + 1) (1 − z 2 )n−1 dz.
−1 dz n−1 dz n−1
Applying this formula n times results in
Z 1
(k + n)! 1
Z
n n
Pl (z)Pk (z) dz = Pl (z)Pk (z) dz.
−1 (k − n)! −1

By the orthogonality of Legendre polynomials (Proposition 4.1) this equals zero


2 (k+n)!
if k 6= l and 2k+1 (k−n)! if k = l, ending the proof.

To facilitate the calculations of the actual constants, we use the series



" l=m
#
X X
l l
f (z, ϕ) = A0,m Pm (z) + Al,m cos lϕPm (z) + Bl,m sin lϕPm (z) , (27)
m=0 l=1

which is the series in Theorem 4.4 after the substitution cos θ = z and a change of
indices. Suppose we want to find An,k in equation (27). It is natural to multiply
the series by cos nϕPkn (z) and integrate over the sphere. Since cos nϕPkn (z)
is a spherical harmonic of degree k, the orthogonality of spherical harmonics
immediately gives that all terms in the outer sum where m 6= k equal zero.
Hence the only possible non-zero inner products are the components of the k:th
term of the outer sum in equation (27). These are of the form
R 2π R 1 R 2π R 1
0 −1
cos nϕPkn (z) cos lϕPkl (z) dz dϕ, 0 −1 cos nϕPkn (z) sin lϕPkl (z) dz dϕ,
R 2π R 1 R 2π R 1
0 −1
cos nϕ sin nϕ[Pkn (z)]2 dz dϕ, 0 −1
cos2 nϕ[Pkn (z)]2 dz dϕ,

where n, l ≤ k and n 6= l. Using the orthogonality of the sin ϕ and cos ϕ


functions over the interval [0, 2π] (used in Fourier analysis) and the Proposition

25
4.5, we can see
R 2πthat 2the only non-zero term above is the last. By Proposition
2π (k+n)!
4.5 and that 0 cos nϕ dϕ = π, the last integral equals 2k+1 (k−n)! . Thus we
get that all the terms except the one involving An,k equals zero and
2π 1
2k + 1 (k − n)!
Z Z
An,k = f (z, ϕ) cos nϕPkn (z) dz dϕ
2π (k + n)! 0 −1

We finally resubstitute cos θ = z so that

2k + 1 (k − n)! 2π π
Z Z
An,k = f (θ, ϕ) cos nϕPkn (cos θ) sin θ dθ dϕ.
2π (k + n)! 0 0

We can calculate the constants A0,k and Bn,k in a similar way. This proves
Theorem 4.4.

26
5 Graphical illustrations
In this section we use the theory from section 4 to create graphical illustrations
of the spherical harmonics. Hopefully the following figures will help to increase
the readers intuition about these.
Several ways of representing the spherical harmonics have been chosen. For
one kind of illustration we emphasize the link to Fourier analysis by letting
the value of the spherical harmonic be represented as distance from a reference
sphere. This corresponds to the representation of the sine and cosine functions
on the unit circle. Secondly a more common representation is used where the
values of the spherical harmonic takes on different colors on the unit sphere. A
third way of illustration is chosen for purposes of literature reference, namely
the squared absolute magnitude of the harmonic. In this illustration the value
at a given point is represented by the distance from the origin.
Finally a less common way to represent spherical harmonics that has not
been found in literature will be attempted. By using stereographic projection,
we can view harmonics as is commonly done when considering a function in
the plane. In Fourier analysis a projection of the unit circle onto the line is
easily accomplished by using the 2π-periodicity of a function defined on the
circle. However, for a function defined on the unit sphere, there is no easy way
of representing the periodicity in the plane. The stereographic projection of a
function corresponds to projection a function on the circle to the real line in
Fourier analysis. It is this way that is chosen to illustrate the main result of the
previous section: the approximation of a given function on the sphere by a sum
of spherical harmonics.

27
5.1 Illustrations
5.1.1 Legendre polynomials and Zonal Harmonics
We start this section by illustrating a few of the Legendre polynomials. Note
that these are well defined on the whole real axis. Here it becomes visually
clear that the polynomials oscillate only in the interval [−1, 1] and that they are
symmetric around z = 0. By construction all the polynomials also pass through
the point (1,1). From the figures one can see that on the interval [−1, 1], the
behavior of Legendre polynomials is similar to both sine and cosine functions.
The amplitude is smaller than the standard sine/cosine function (this can be
remedied by a constant) but the oscillatory behavior is related. The polynomials
plotted in Figure 1 are
5 3 3 6435 8 3003 6 3465 4 315
P3 (z) = z − z, P8 (z) = z − z + z −
2 2 128 32 64 32
9694845 15 35102025 13 50702925 11 37182145 9
P15 (z) = z − z + z − z
2048 2048 2048 2048
14549535 7 2909907 5 255255 3 6435
+ z − z + z − z
2048 2048 2048 2048

From Proposition 4.1 it follows that the Legendre polynomials restricted to


the interval [−1, 1] times a normalizing constant are really zonal harmonics.
In Figure 2, to the right of Figure 1, the zonal harmonics Z3 , Z8 and Z15
corresponding to P3 (z), P8 (z) and P15 (z) are plotted. By corresponding, we
mean that the normalization constant from Proposition 4.1 has been used in
such a way that the zonal harmonics plotted in this study attain the same values
as the Legendre polynomials. In Figure 2a the squared absolute magnitude of
Z3 is plotted. Because the value of the plotted zonal harmonics never surpass
|Zk | ≤ 1 (since the normalization constant is used) we can use the unit sphere
as a reference surface (just like the unit circle is a reference for sine and cosine)
as a way of plotting Z8 . This is shown in Figure 2b. The last zonal harmonic
is illustrated in Figure 2c as values on the unit sphere.
Note that when comparing the Legendre polynomials in Figure 1 to the
zonal harmonics in Figure 2, that because of the substitution cos θ = z, the
right hand side of the graphs is the north pole in the three dimensional fig-
ures. From Figures 1 and 2 one can see that there is no clear advantage of the
three dimensional way of illustrating a zonal harmonic versus the polynomial
representation in the Legendre polynomials. The connection between two and
three dimensions is even easier to imagine when seeing the oscillating pattern of
Figure 1. Specially Figure 2a does not aid us in any way to visualize the zonal
harmonic, and Figures 2b and 2c do not give us any additional information that
is not contained in the corresponding graphs.

28
Legendre polynomial of degree 3
1.5
3
P3(x) = 5/2 x −3/2 x Value of |Z |2
3

1 1

0.5 0.5

0 0

z
−0.5 −0.5

−1 −1

0.2 0.1 0.2


0.1 0 0
−1.5 −0.1 −0.2 −0.1
−1.5 −1 −0.5 0 0.5 1 1.5 −0.2
x y x

(a) (a)
Legendre polynomial of degree 8
1.5
8 6 4 2
P8(x) = 6435/128 x −3003/32 x +3465/64 x −315/32 x +35/128

0.5

−0.5

−1

−1.5
−1.5 −1 −0.5 0 0.5 1 1.5
x

(b) (b)
Legendre polynomial of degree 15
1.5
P (x) = 9694845/2048 x15−35102025/2048 x13+...−6435/2048 x
15

0.5

−0.5

−1

−1.5
−1.5 −1 −0.5 0 0.5 1 1.5
x

(c) (c)

Figure 1: Legendre polynomials. Figure 2: Zonal harmonics.


a) P3 (z), b) P8 (z) and c) P15 (z). a) Z3 , b) Z8 and c) Z15 .

29
5.1.2 Spherical Harmonics
For the graphical representation of general spherical harmonics, we will use the
function Ỹkn from Definition 4.3, with constants A, B = 1. The value of the
constants A and B does not significantly change the general appearance of the
spherical harmonic, they only change its magnitude and rotate the harmonic in
the variable ϕ. Since spherical harmonics can take on values greater than one,
we can not use the same approach as with the zonal harmonics. In order to
keep the same type of representation as in Figure 2b, we approach this problem
by increasing the radius of the reference sphere to the maximum of |Ỹkn |. Hence
the minimum value of the spherical harmonic will again be close to the origin.
Note that when the order of the spherical harmonic equals the degree, that is
n = k in relation (25)

Ỹkk = (cos kϕ + sin kϕ) (sink θ)AP ,

where AP is the constant resulting from the k:th derivative of the Legendre
polynomial. This gives that the positions on the sphere where Ỹkk equals zero is
dependent only on ϕ, since the factor sin θ is zero only at the poles. Hence we
have a spherical harmonic that has a zonal structure that is perpendicular to
zonal harmonics. This special case of a spherical harmonic is called a sectorial
harmonic ([8, p. 132]), and is plotted in Figure 4b.
In Figure 3a the squared absolute magnitude of Ỹ32 is illustrated. This rep-
resentation of a spherical harmonic is mostly used when Ỹkn is complex-valued,
since it is the only effective way of plotting the imaginary part of Ỹkn . Since
we have restricted our graphical illustrations to real-valued spherical harmonics,
this representation does not help us in any way to see the connection between
the trigonometrical functions and spherical harmonics. The illustration in Fig-
ure 3b is an analogue to the trigonometrical functions on the circle, and it is
an effective way to show the oscillatory behavior of a spherical harmonic. The
disadvantage is that it is hard to tell what value the harmonic takes in a specific
point. On the other hand, this is adequately represented in Figure 4a. The
compromise one makes with this type of illustration, which is a more accurate
way of presenting the values of the spherical harmonic, is that the general shape
of the function can be harder to make out. From Figure 4b we can see that for
the sectorial harmonic of degree 5, there are 10 sectors (a sector being a part
of the sphere where the spherical harmonics is only positive or negative valued)
and that these are π5 apart (in the variable ϕ).

30
22 40
Value of |Y3|

30
50
20

10

0
z

−10

−50
−20
50
50 −30
0
0
−50 −50 −40
y x

(a) (a)

(b) (b)

Figure 3: Spherical harmonics. Figure 4: Spherical harmonics.


a) |Ỹ32 |2 and b) Ỹ83 on a reference sphere. 4
a) Ỹ15 on the unit sphere and b) Ỹ55 , a
sectorial harmonic.

31
5.1.3 Approximation of functions in stereographic coordinates
So far we have followed the natural choice of expressing spherical harmonics in
spherical coordinates. However, the surface of the sphere can be mapped to a
plane through the means of stereographic projection. This can be accomplished
by fixing a point on the surface of the sphere, the projection point, and defining
a plane onto which points on the sphere can be projected. The plane is chosen
so that its normal goes through both the origin and the projection point.
The main reason for exploring spherical harmonics in a stereographic coordi-
nate system is the reduction of discontinuities. In a spherical coordinate system
there exist discontinuities in two points, one when the angle θ ± n · 2π = 0 and
the other at θ ± n · 2π = π, where n = 0, 1, . . . . At these points the angle ϕ can
not be single-valued. In a stereographic projection a discontinuity exists in only
one point, the projection point. If this point is to be projected onto the plane,
its distance from the origin would be infinite and it would be defined in every
direction.
For the projection of spherical harmonics the unit sphere with the projection
point (x, y, z) = (0, 0, 1) is chosen. The plane onto which the points of the sphere
are projected is the xy-plane, that is the equatorial plane. From the reasoning
above it is clear that stereographic projection is a mapping from S 2 → R2 and
that a point on the sphere P = (x, y, z) is projected to a point P ′ = (x′ , y ′ , 0) or
P ′ = (x′ , y ′ ). By basic geometry and the fact that the radius of the sphere equals
one, it is possible to derive the following relations in Cartesian coordinates.

x x′ x
= ⇐⇒ x′ = .
1−z 1 1−z
Similarly
y
y′ =.
1−z
The purpose of this section is to investigate the change of variables in the spher-
ical coordinate system that lead to stereographic coordinates. The relations for
this transformation are derived in a similar way as for the Cartesian system
described above. It is suitable to use the standard polar coordinate system to
describe the position of a point in the plane, that is P ′ = (ρ, ϕ). Since the
azimuthal angle does not change when projected onto the plane, it remains to
find ρ as a function of θ. The geometry of triangles can be used to see that
sin θ ρ sin θ
= ⇐⇒ ρ= .
1 − cos θ 1 1 − cos θ
Furthermore, using the trigonometrical identities sin 2θ = 2 sin θ cos θ and cos 2θ =
1 − 2 sin2 θ, the following useful expression for θ can be derived.

sin 2 θ2 2 sin θ2 cos θ2 2 sin θ2 cos θ2 cos θ2


= = = .
1 − cos 2 θ2 1 − (1 − 2 sin2 θ2 ) 2 sin2 θ
2 sin θ2

According to the relation between spherical and stereographic projections above


we have that
θ
cot = ρ.
2

32
Hence, given the calculations above, the important relations between spherical
and stereographic coordinates can be summarized as follows:
   
sin θ θ
(ρ, ϕ) = , ϕ = cot , ϕ and
1 − cos θ 2
1
θ = 2 tan−1 . (28)
ρ
For a derivation of the spherical Laplace operator in stereographic coordinates,
see Appendix A.1.1
To avoid the discontinuity at the projection point, we choose to only project
the bottom part of the sphere (and spherical harmonic). That is we restrict
π/2 ≤ θ ≤ π. This means that the harmonic will parametrized by the unit disc,
and that the z-axis in the stereographic projection represents the value of the
spherical harmonic. In Figures 5a and 5b the stereographic projections of Z8
from Figure 6a and Ỹ32 from 6b are shown. We can see that the zonal harmonic
becomes a radial function. This is to be expected, since a given latitude on the
sphere (θ is fixed) is projected onto a circle of radius tan θ2 , according to the
relation above. Since zonal harmonics are constant on latitudes of the sphere (see
Figures 1 and 2), the projected zonal harmonic will be constant on concentric
circles.
When approximating a given function f we use only a finite number of terms
from the spherical harmonic series expansion of f . In this section the approxi-
mation of a given function is a sum of spherical harmonics up to degree k, for a
chosen fixed k. To see how these sums of spherical harmonics approximate the
chosen functions, different numbers of terms from the series are included. The
graphical representations presented below are plotted using the stereographic
projection and are a direct application of the theory from section 4.5.
We start by approximating a smooth function defined on the sphere f (θ, ϕ) =
cos 4θ θ
2 + sin 2 , shown in Figure 7a. The choice of using a function dependent only
on the variable θ is to avoid the problem of ϕ not being single-valued at the
poles of the sphere, which can cause the function to be not smooth in the areas
surrounding these. The two approximations of the chosen function (Figure 7b
and 8a) are expansions of f up to degree 3 and 14. The difference plotted in
Figure 8b is f minus the approximation of f . We will denote the approximation
of f up to degree k as fAk and the difference f − fAk as fDk . From Figure 7
we can see that the first approximation fA3 has not yet started to resemble the
original function. This is because of the small number of terms included in the
approximating sum. However, from the plot of fA14 we can visually confirm
that after only 14 spherical harmonics the approximation is almost identical to
f . This is also evident in Figure 8b, where the magnitude of fD14 is in the order
of 10−4 , which is small compared to the values taken by f .
In Figure 9 we approximate a function that is not continuous on the sphere,
namely f (θ, ϕ) = π2 − ϕ. This is to graphically examine what happens near
points where the function is discontinuous. Figure 9 shows the stereographic
projection of f as well as fA3 , and in Figure 10 fA14 and fD14 are plotted. One
can notice two things about the approximations. First, in the illustration of
the approximating function in Figure 10a it looks like the section connecting
the surfaces at the line of discontinuity only takes on two distinct color-values.
This is because MATLAB can only assign one color to each partition of the

33
plotted surface. Near the discontinuity, the connecting section is so steep that
only two partitions fit the surface. This is not true, since spherical harmonics
are continuous and take all values between 0 and 2π. Secondly, in Figure 10b, it
becomes apparent that something similar to the Gibbs phenomenon in Fourier
analysis exists in spherical harmonic expansions. This means that at the line
of discontinuity an increase in oscillation can be observed in the approximating
partial sums. Note that the difference fD14 for this function is much larger than
in the approximation of the smooth function. In Figure 10b we see that for
some points, the magnitude of fD14 is in the same order as the values of the
original function.
The final graphical example is an approximation of the function f (θ, ϕ) =
θ3 cos (6θ) sin ϕ. This function is chosen to examine the approximating function
when the original function has a more complicated oscillatory behavior and is
dependent on both θ and ϕ. Note that f is discontinuous at the south pole.
The stereographic projection of f is shown in Figure 11 and the approximating
function fA3 in Figure 12. From Figure 13b one can see that the largest discrep-
ancies of the approximated function from f are near the point of discontinuity or
where the function oscillates intensely. Hence the Gibbs phenomenon is present
even though f only has a point discontinuity. Comparing Figures 10b and 13a
it seems that the expansion converges faster to f than in the previous approxi-
mation. Hence it seems that functions with point discontinuity are more easily
approximated than functions with line discontinuity, and that the expansions of
smooth functions converge faster than expansions of discontinuous functions of
any kind. This concludes our study about spherical harmonics.

34
Y0 in stereographic projection
8
0.8

1 0.6

0.5 0.4
z

0 0.2

−0.5 0

1
0.5 1 −0.2
0 0.5
−0.5 0
−0.5
−1 −1
y x

(a) (a)
8
Y23 in stereographic projection
6

4
5

0
z

−5 −2

−4
1
0.5 1
0.5 −6
0
0
−0.5
−0.5 −8
y −1 −1
x

(b) (b)

Figure 5: Stereographic projections. Figure 6: Functions on the part of the


a) Z8 (x) and b) Ỹ32 . sphere used for stereographic projec-
tion.
a) Z8 (x) and b) Ỹ32 .

35
Chosen Function Spherical Harmonic expansion

Spherical harmonic expansion up to degree 14


f(u,v) 1.4 1.4

1.3 1.3
1.8 1.8
1.6 1.2 1.6 1.2

1.4 1.1 1.4 1.1


1.2 1.2
1 1
z

z
1 1
0.9 0.9
0.8 0.8
0.6 0.8 0.6 0.8

0.7 0.7
1 1
0.5 0.6 0.5 0.6
1 1
0 0.5 0 0.5
−0.5 0 0.5 −0.5 0 0.5
−0.5 −0.5
−1 −1 −1 −1
y x y x

(a) (a)
Spherical Harmonic expansion Difference −4
x 10

Spherical harmonic expansion up to degree 3 −4 10


x 10 Difference

1.1 8

10
1 6

5
0.9 4
z

0 2
0.8

−5 0
0.7
1 1
0.5 1 0.5 1 −2
0 0.5 0 0.5
−0.5 0 −0.5 0
−0.5 −0.5 −4
−1 −1 −1 −1
y x y x

(b) (b)

Figure 7: a) Stereographic projection of Figure 8: a) The approximation fA14


f = (θ, ϕ) = cos24θ + sin θ2 and b) The and b) the difference fD14 .
approximation fA3 .

36
Chosen Function Spherical Harmonic expansion

f(u,v) Spherical harmonic expansion up to degree 14


2 2 1
1 1

0 0
0

−1 −1
−1
−2

z
−2
z

−3 −2
−3
−4
−4
−5 −3
−5
−6
−6 −4
1
1
0 1 0
0.5 0.5 1
−0.5 0 −1 0
−1 −1 −1 −0.5
y x y
x

(a) (a)
Spherical Harmonic expansion Difference

Spherical harmonic expansion up to degree 3 1.5


1 Difference
2 2

1 1.5 1
0
0 1
0.5
−1 −1 0.5

−2
z

0 0
z

−3 −2 −0.5
−0.5
−4 −1
−3
−5 −1.5
−1
−6 −2
−4 1
1 1
0.5 1 0.5 0.5 −1.5
0 0 0.5 0 0
−0.5 −0.5 −0.5 −0.5
−1 −1 −1 −1
y x y x

(b) (b)

Figure 9: a) Stereographic projection of Figure 10: a) The approximation fA14


f = π2 − ϕ and b) The approximation and b) the difference fD14 .
fA3 .

37
Chosen Function
30

f(u,v)

20

30
10
20

10
0
0
z

−10 −10
−20 1
0.5
−30 −20
1 0
0.5
0 −0.5
−0.5 −30
−1 −1 x
y

Figure 11: Stereographic projection of f (θ, ϕ) = θ3 cos 6θ sin ϕ.

Spherical Harmonic expansion

Spherical harmonic expansion up to degree 3


1.5

1
2

0.5
1
0

0
z

−0.5

−1 1 −1

0 −1.5
−2
1
0.5
0
−0.5 −1 x
−1
y

Figure 12: Stereographic projection of the spherical harmonic expansion up to


degree 3 of f (θ, ϕ) = θ3 cos 6θ sin ϕ.

38
Spherical Harmonic expansion

Spherical harmonic expansion up to degree 14


15

10
20

5
10

0
0
z

−5
−10
1 −10
0.5
−20
1 0 −15
0.5
0 −0.5
−0.5
−1 −1 x
y

(a)

Difference
30

Difference
20

30
10
20

10 0

0
z

−10 −10
1
−20
0.5
−20
−30 0
1
0.5 −0.5
0 −30
−0.5 −1 x
−1
y

(b)

Figure 13: Stereographic projection of the spherical harmonic expansion up to


degree 14 of f (θ, ϕ) = θ3 cos 6θ sin ϕ and the difference between the two.

39
A Appendix A
A.1 The Laplace operator in Spherical Coordinates
A problem can sometimes be simplified if one changes coordinates from the
regular Cartesian xyz-system to a more suitable way of describing the position
of any given point. The most common examples of such systems are cylindrical
and spherical coordinates (for a thorough discussion about the Laplace operator
in spherical coordinates, see [3], p. 66-67).
In cylindrical coordinates a point in space is described in the same way as
in polar coordinates, with the addition of the z-axis having the same role as in
the Cartesian coordinates. In this way, any point in Cartesian coordinates can
be transformed to cylindrical coordinates with the relations

x = ρ cos ϕ, y = ρ sin ϕ, z = z, (29)

and p y
ρ= x2 + y 2 , ϕ = tan−1 , z = z, (30)
x
where ρ is the distance from the origin in the xy-plane and θ is the angle between
the x-axis and ρ̂. Similarly one can derive the relations between Cartesian and
spherical coordinates,

x = r sin θ cos ϕ, y = r sin θ sin ϕ, z = r cos θ, (31)

where r is the distance from the origin, ϕ is the angle between the x-axis and
the projection of r̂ in the xy-plane and θ is the angle between the z-axis and r̂.
Furthermore, from equation (29) and equation (31) one can deduce the relations
between cylindrical and spherical coordinates to be

z = r cos θ, ρ = r sin θ, ϕ = ϕ. (32)

Note the similarity between equation (29) and equation (32). This relation will
be useful in significantly shortening the derivation of the Laplace operator. To
be able to determine whether a given function f (r, ϕ, θ) is harmonic one must
be able to express Laplace’s equation

fxx + fyy + fzz = 0

as an operator involving r, ϕ and θ only. The most straightforward way of


accomplishing this is to use the relations in (31) together with the chain rule.
However, this process is long and it does not enlighten the reader in any special
way. Therefore, an approach using the laplacian in cylindrical coordinates and
the aforementioned similarity between equation (29) and equation (32), that
hopefully highlights the process of using the chain rule, will be opted here.
Using the chain rule in cylindrical coordinates is fairly straightforward, and
results in the laplacian in cylindrical coordinates

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


∆f = + + + (33)
∂ρ2 ρ ∂ρ ρ2 ∂ϕ2 ∂z 2

for the function f (ρ, ϕ, z).

40
To derive the laplacian in spherical coordinates, one can use that the ex-
pressions (29) and (32) are identical except for notation. Motivated by this a
change of notation (y → ρ, ρ → r, ϕ → θ and x → z) the relations
∂f ∂f cos θ ∂f
= sin ϕ + (34)
∂ρ ∂r r ∂θ
and
∂2f ∂2f 1 ∂f 1 ∂2f
2
= 2
+ + 2 2 (35)
∂z ∂r r ∂r r ∂θ
can be derived. When comparing the laplacian in cylindrical coordinates in
equation (33) and equation (35), one can see that two of the terms are repre-
sented in both expressions. Furthermore, the relations in (32) together with
equation (34) suggest that the remaining terms can be expressed as
1 ∂f 1 ∂2f 1 ∂f cot θ ∂f 1 ∂2f
+ 2 2
= + 2 + 2 2 . (36)
ρ ∂ρ ρ ∂ϕ r ∂r r ∂θ r sin θ ∂ϕ2
Adding equation (35) and equation (36) covers all of the the terms in the ex-
pression for the cylindrical laplacian. Hence the sum of these two expressions
give the laplacian for spherical coordinates
∂2f 2 ∂f 1 ∂2f 1 ∂2f 1 ∂2f cot θ ∂f
∆f = 2
+ + 2 2 + 2 2 2
+ 2 2 + 2 (37)
∂r r ∂r r ∂θ r sin θ ∂ϕ r ∂θ r ∂θ
for a function f (r, ϕ, θ). This can also be written as
∂2f
   
1 ∂ 2 ∂f 1 1 ∂ ∂f
∆f = 2 r + 2 2 + 2 sin θ . (38)
r ∂r ∂r r sin θ ∂ϕ2 r sin θ ∂θ ∂θ
For the purpose of spherical harmonics it will be convenient to define the
spherical Laplace operator ∆s as the part of equation (38) that is independent
of r, that is
1 ∂2f
 
1 ∂ ∂f
∆s = sin θ + . (39)
sin θ ∂θ ∂θ sin2 θ ∂ϕ2

A.1.1 The spherical Laplace operator in stereographic coordinates


Consider the spherical Laplace operator, as defined in equation (39) for a func-
tion f (θ, ϕ). The objective of this section is to calculate ∆s f for a function
f (ρ, ϕ) in stereographic coordinates, where a change to the variables ρ and ϕ
has been made according to equation (28). Since only the partial derivatives of
f with respect to θ are affected, we start by calculating these. Using equation
(28), a few relations that will be helpful in the forthcoming calculations can be
derived:
dρ 1 (ρ2 + 1)
= =− (40)
dθ dθ 2

and
ρ2 + 1 sin2 θ 1 1 − 2 cos θ + cos2 θ + sin2 θ
   
1
= +1 =
2 2 (1 − cos θ)2 2 (1 − cos θ)2
1 2(1 − cos θ) 1
= = . (41)
2 (1 − cos θ)2 1 − cos θ

41
Given the relations in (40) and (41), the first and second partial derivatives for
a function f (ρ, ϕ) can be expressed as

∂f ∂f dρ ∂f 1
= =− and
∂θ ∂ρ dθ ∂ρ 1 − cos θ
∂2f ∂2f 1 ∂f sin θ
2
= 2 2
+ .
∂θ ∂ρ (1 − cos θ) ∂ρ (1 − cos θ)2

With the appropriate variable change from (θ, ϕ) → (ρ, ϕ), using the chain rule
for composite functions in the expression for the spherical Laplace operator for
a function f (ρ, ϕ) gives
   2 
cos θ ∂f 1 ∂ f 1 ∂f sin θ
∆s f = − + +
sin θ ∂ρ 1 − cos θ ∂ρ2 (1 − cos θ)2 ∂ρ (1 − cos θ)2
1 ∂2f
+
sin2 θ ∂ϕ2
∂f 1 ∂2f 1 1 ∂2f
= + 2 +
∂ρ sin θ(1 − cos θ) ∂ρ (1 − cos θ) 2
sin2 θ ∂ϕ2
∂f 1 − cos θ ∂ 2 f
 
1 1 ∂f
= + +
(1 − cos θ)2 ∂ρ sin θ ∂ρ2 sin2 θ ∂ 2 ϕ
(ρ2 + 1)2 1 ∂f
 ∂2f 1 ∂2f 
= + 2 + 2 2
4 ρ ∂ρ ∂ρ ρ ∂ ϕ
(ρ2 + 1)2  ∂f 2 ∂ 2
f ∂2f 
= ρ + ρ + . (42)
4ρ2 ∂ρ ∂ρ2 ∂2ϕ

Note that the expression in brackets in equation (42) is the laplacian in polar
coordinates (see Appendix A.1). Hence the laplacian in stereographic coordi-
nates, regarding functions defined on the unit sphere, is a function of ρ times
the laplacian in polar coordinates.

B Appendix B
For this study, MATLAB was used to plot all the figures in section 5. A sepa-
rate code was written for every type of function. However, since the script for
approximating functions contains most of the code written, only this script will
be included to not overburden the appendix. The script can be copied into the
MATLAB editor and used without any processing.
The script below produces the approximating sum of a chosen function that
is defined on the sphere. Furthermore, it uses stereographic projection to plot
the chosen function, approximating function and their difference. Calculations
in the script can be used to plot for instance zonal or spherical harmonics,
but a specification how to graphically represent these would have to be added
in the code. One known problem with this source code, is that for too large
n (if the degree of spherical harmonics included in the sum is around 30 or
larger, depending on the function approximated), MATLAB cannot process the
calculations due to a too large directory name.
function y = SpHarmonicapprx(func,n)

%SPHARMONICAPPRX(func,n) approximates a given function of two variables


%(u,v)=(theta,phi),that is defined on the unit sphere, by expanding it into

42
%spherical harmonics. The variables u,v must be symbolic and n refers to the
%first summation index, thus producing the first (n)*(n+1)/2 terms of the
%series expansion.

%Error statement regarding the number of input arguments


if nargin > 2 || nargin < 2
error(['Wrong number of input arguments. Arguments must contain the number'...
'of terms in expansion (n) and the function to be approximated.'])
end

%Error statement regarding the allowed values of n


if numel(n) > 1 || ~isreal(n) || n ~= round(n)
error('n must be a positive scalar integer')
end

%Introducing symbolic variables


syms x k q c u v;
C = c ;

%Computing the Zonal Harmonics with its norm squared (pi factor omitted
%in these calculations for clarity in output),ZNn,up to degree n and sorting
%them in a 1x(n+1) matrix = [ZN0 ZN1 ZN2 ... ZNn]. This is used when computing the
%constants A0. Also computes the Zonal Harmonics for the series and
%arranges them in a matrix [Z0 Z1 ... Zn].
ZNtot = [];
Ztot = [];
for i = 0:n
s = floor(i/2);
f = ((-1)^k/sym('k!'))*sym('(2*q - 2*k)!')/(sym('(q -2*k)!')*sym('(q - k)!'))*x^(q - 2*k);
Pol = (1/2^q)*symsum(f,k,0,s);
Legendre = subs(Pol,q,i);
Legsimple = simplify(Legendre);
P = expand(Legsimple);
ZN = (2*i+1)/(4)*subs(P,x,cos(u));
ZNtot = [ZNtot ZN];
Z = subs(P,x,cos(u));
Ztot = [Ztot Z];
end
Ztot = Ztot;
ZNtot = ZNtot;

%Computing every order of the Associated Legendre function with its norm squared
%(pi factor omitted in these calculations for clarity in output),PNmn, up to degree n,
%sorting them in two 1x(n(n+1)/2) -matrixes with the corresponding sine or cosine
%function [cos(v)*PN11 cos(v)*PN12 cos(2v)*PN22 cos(v)*PN31... cos(n-1)*PN(n-1)n
%cos(nv)*PNnn] and the same for sine. Also computes the Spherical Harmonics
%for the series expansion and arranges them in two matrixes [cos(v)*P11 ...
%cos(nv)*Pnn] and [sin(v)*P11... ]
Ycos = [];
YNcos = [];
for i = 1:n;
s = floor(i/2);
f = ((-1)^k/sym('k!'))*sym('(2*q - 2*k)!')/(sym('(q -2*k)!')*sym('(q - k)!'))*x^(q - 2*k);
Pol = (1/2^q)*symsum(f,k,0,s);
Legendre = subs(Pol,q,i);
Legsimple = simplify(Legendre);
P = expand(Legsimple);
Yleg = [];
Pleg = [];
for j = 1:i
Pmnx = diff(P,j);
YNmncos = (2*i+1)/(2)*factorial(i-j)/factorial(i+j)*cos(j*v)*sin(u)^j*subs(Pmnx,x,cos(u));
Yleg = [Yleg YNmncos];
Pmn = cos(j*v)*sin(u)^j*subs(Pmnx,x,cos(u));
Pleg = [Pleg Pmn];
end
YNcos = [YNcos Yleg];
Ycos = [Ycos Pleg];
end
YNcos = YNcos;
Ycos = Ycos;

Ysin = [];
YNsin = [];

43
for i = 1:n;
s = floor(i/2);
f = ((-1)^k/sym('k!'))*sym('(2*q - 2*k)!')/(sym('(q -2*k)!')*sym('(q - k)!'))*x^(q - 2*k);
Pol = (1/2^q)*symsum(f,k,0,s);
Legendre = subs(Pol,q,i);
Legsimple = simplify(Legendre);
P = expand(Legsimple);
Yleg = [];
Pleg = [];
for j = 1:i
Pmnx = diff(P,j);
YNmnsin = (2*i+1)/(2)*factorial(i-j)/factorial(i+j)*sin(j*v)*sin(u)^j*subs(Pmnx,x,cos(u));
Yleg = [Yleg YNmnsin];
Pmn = sin(j*v)*sin(u)^j*subs(Pmnx,x,cos(u));
Pleg = [Pleg Pmn];
end
YNsin = [YNsin Yleg];
Ysin = [Ysin Pleg];
end
YNsin = YNsin;
Ysin = Ysin;

%Calculating the coefficients A0n (for Zonal Harmonics) and Anm (for cos*Pmn) and
%Bnm (for sin*Pmn) of the series of Spherical Harmonics.
A0tot = [];
a0 = numel(ZNtot);
F = func*sin(u);
for i = 1:a0;
Z = ZNtot(1,i);
A0 = int(int(F*Z,v,0,2*pi),u,0,pi);
A0tot = [A0tot A0];
end
A0tot = A0tot;

a = numel(YNcos);
Atot = [];
for i = 1:a;
Pcos = YNcos(1,i);
A = int(int(F*(Pcos),v,0,2*pi),u,0,pi);
Atot = [Atot A];
end
Atot = Atot;

b = numel(YNsin);
Btot = [];
for i = 1:b;
Psin = YNsin(1,i);
B = int(int(F*(Psin),v,0,2*pi),u,0,pi);
Btot = [Btot B];
end
Btot = Btot;

%The final expression in terms of the appropriate constants times the


%spherical harmonics.

S = Ztot*(A0tot)' + Ycos*(Atot)' + Ysin*(Btot)';


y1 = S/pi;
y = simplify(y1);
y2 = vpa(y); %Used for expansions containing many terms,
%as MATLAB cannot handle too long function Directory names

%Projecting the Spherical Harmonic expansion onto the disc with radius 1
%with the aid of Stereographic Coordinates. Only the bottom part of the
%sphere (pi/2 < theta > pi) is projected to avoid the dicontinuities in the
%projection point, (0,0,1).
figure('Name','Spherical Harmonic expansion');
ezsurf(sin(u)*cos(v)/(1 - cos(u)),sin(u)*sin(v)/(1 - cos(u)),y2,[pi/2,pi,0,2*pi])
%colormap([1 .1 .6])
legend(['Spherical harmonic expansion up to degree ' int2str(subs(C,c,n))],'Location','Best')
set(gca,'Title',text('String','Spherical Harmonic expansion'));

%Projecting the chosen function, defined on the sphere, onto the disc of radius 1.

44
figure('Name','Stereographical projection of chosen function for reference');
ezsurf(sin(u)*cos(v)/(1 - cos(u)),sin(u)*sin(v)/(1 - cos(u)),func,[pi/2,pi,0,2*pi])
%colormap([0 0 1])
legend('f(u,v)')
set(gca,'Title',text('String','Chosen Function'));

%A surface plot of the difference between the chosen function and its
%Spherical harmonic approximation of degree n
if simple(y-func)==0
figure1 = figure(...
'Color',[1 1 1],...
'PaperPosition',[0.6345 6.345 20.3 15.23],...
'PaperSize',[20.98 29.68]);
annotation1 = annotation(...
figure1,'textbox',...
'Position',[0.08214 0.3452 0.8143 0.5669],...
'LineStyle','none',...
'Color',[0 0.749 0.749],...
'FitHeightToText','off',...
'FontName','Bell MT',...
'FontSize',35,...
'HorizontalAlignment','center',...
'String',{'The chosen function','and the Spherical','Harmonic expansion','are identical!'});
else
figure('Name','Difference between function and approximation');
ezsurf(sin(u)*cos(v)/(1 - cos(u)),sin(u)*sin(v)/(1 - cos(u)),func-y2,[pi/2,pi,0,2*pi]);
legend('Difference')
end
set(gca,'Title',text('String','Difference'))

45
References
[1] Axler, S., Bourdon, P. and Ramey, W. Harmonic Function Theory. Springer-Verlag New York,
Inc., 2nd edition, 2001. Digital Copy.

[2] Biggs, N. L. Discrete Mathematics. Oxford University Press, 2nd edition, 2002.

[3] Brown, J. W. and Churchill, R. V. Fourier Series and Boundary Value Problems. McGraw-
Hill Companies, Inc., 7th edition, 2008.

[4] Byerly, W. E. An Elementary Treatise on Fourier’s Series and Spherical, Cylindrical and
Ellipsoidal Harmonics, with Applications to Problems in Mathematical Physics. Dover Pub-
lications, Inc., 1893. Digital Copy.

[5] Greub, W. H. Linear Algebra. Springer-Verlag New York, Inc., 3rd edition, 1967. Digital Copy.

[6] Jerri, A. J. Integral and Discrete Transforms with Applications and Error Analysis. Marcel
Dekker Inc., 1992. Digital Copy.

[7] Krantz, S. G. A Panorama of Harmonic Analysis. The Mathematical Association of America


(Incorporated), 1999.

[8] MacRobert, T. M. Spherical Harmonics: An Elementary Treatise on Harmonic Functions


with Applications. Methuen & Co. Ltd., London, 2nd edition, 1947. Digital Copy.

[9] Phillips, G. M. Interpolation and Approximation by Polynomials. Springer-Cerlag New York,


Inc., 2003. Digital Copy.

[10] Retherford, J. R. Hilbert Space: Compact Operators and the Trace Theorem. Cambridge
University Press, 1993. Digital Copy.

[11] Rudin, W. Principles of Mathematical Analysis. McGraw-Hill Companies, Inc., 3rd edition,
1976.

46

You might also like