3.41. Operators

3.41.1. Introduction

The domain of the operator A is D(A), a subspace of the Hilbert space \mathscr{H}. Linear operator is:

A (\alpha \ket{u} + \beta \ket{v}) = \alpha A \ket{u} + \beta A \ket{v}

for all \ket{u}, \ket{v} \in D(A). Symmetric operator is:

\braket{u|Av} = \braket{Au|v}

for all \ket{u}, \ket{v} \in D(A) dense in \mathscr{H}. If D(A) is dense in \mathscr{H}, then the adjoint operator A^\dag is defined by

\braket{u|A^\dag v} = \braket{Au|v}

for all \ket{u} \in D(A). The domain D(A^\dag) is given by all \ket{v} for which the above relation holds. It can be shown that D(A) \subset D(A^\dag).

Operator A is self-adjoint if A = A^\dag. Symmetric operator is self-adjoint only if D(A) = D(A^\dag). (Bounded symmetric operator is always self-adjoint.) Hermitean operator is a bounded symmetric operator.

Hermitian implies self-adjoint implies symmetric, but all converse implications are false. Below, we need the operator to be self-adjoint (we assume unbounded by default).

3.41.2. Spectrum

To obtain a spectrum of the operator A, we need to solve the following problem:

A \ket{\lambda} = \lambda \ket{\lambda}

Those values of \lambda for which the solution \ket{\lambda}\in\mathscr{H} belong to the discrete part of the spectrum. \lambda are called eigenvalues and \ket{\lambda} eigenvectors. Those values of \lambda for which \ket{\lambda} can be normalized to a delta function:

\braket{\lambda|\kappa} = \delta(\lambda-\kappa)

belong to the continuous part of the spectrum (note that in this case \ket{\lambda}\notin\mathscr{H}).

Eigenvectors belonging to the continous part of the spectrum obey the completeness relation:

\int \ket{\lambda}\bra{\lambda} \d \lambda = \one

Eigenvectors belonging to the discrete part obey the following completeness relation:

\sum_\lambda \ket{\lambda}\bra{\lambda} \d \lambda = \one

The sum or integral runs over the whole spectrum (if the spectrum contains both discrete and continous part, we simply combine sums and integrals).

Spectrum of a self-adjoint operator is real, because

\braket{\lambda|A|\lambda} = \lambda \braket{\lambda|\lambda} =
    \lambda^* \braket{\lambda|\lambda}

The eigenvectors are orthogonal:

\braket{\lambda|A|\kappa} = \kappa \braket{\lambda|\kappa} =
    \lambda \braket{\lambda|\kappa}

(\kappa-\lambda) \braket{\lambda|\kappa} = 0

So for \kappa\ne\lambda we get \braket{\lambda|\kappa}=0, for \kappa=\lambda the \braket{\lambda|\lambda} is equal to 1 if \lambda belongs to the discrete spectrum and we get:

\braket{\lambda|\kappa} = \delta_{\lambda\kappa}

or it is normalized as a delta function if it belongs to the continous part:

\braket{\lambda|\kappa} = \delta(\lambda-\kappa)

As such, eigenvectors of a self-adjoint operator are complete and orthogonal in the above sense. Thus any function from the space can then be expanded into the series:

f(x) = \braket{x|f} = \sum_\lambda \braket{x|\lambda}\braket{\lambda|f}

where \braket{x|\lambda} are the eigenvectors and the coefficients \braket{\lambda|f} are given by:

\braket{\lambda|f} = \int \braket{\lambda|x}\braket{x|f} \d x
    = \int \braket{\lambda|x} f(x) \d x

The sum over \lambda runs over the whole spectrum (i.e. it becomes an integral over the continuos parts). Also the coefficients \braket{\lambda|f} are either discrete or continous depending on the part of the spectrum. The series converges in the norm, i.e. the following norm goes to zero as we sum over \lambda:

\left\| f(x) - \sum_\lambda \braket{x|\lambda}\braket{\lambda|f} \right\|
    \to 0

3.41.3. Derivative Operator

We have the eigenvalue problem

A u = \lambda u

where

A = -i {\d \over \d x}

The operator A is unbounded. A is self-adjoint if:

\int_a^b u^*(x) A v(x) \d x = \int_a^b (A u(x))^* v(x) \d x

So

\int_a^b u^*(x) A v(x) \d x
    = \int_a^b u^*(x) \left(-i {\d \over \d x}\right) v(x) \d x =

    = \int_a^b \left(i {\d \over \d x} u^*(x) \right) v(x) \d x
        -i[u^*(x) v(x)]^b_a =

    = \int_a^b \left(-i {\d \over \d x} u(x) \right)^* v(x) \d x
        -i[u^*(x) v(x)]^b_a =

    = \int_a^b (A u(x))^* v(x) \d x -i[u^*(x) v(x)]^b_a

The operator is self-adjoint if and only if [u^*(x) v(x)]^b_a=0. Few boundary conditions that satisfy this condition:

  • Dirichlet boundary conditions

u(a) = 0, \quad u(b) = 0

  • Periodic boundary conditions

u(a) = u(b)

  • Antiperiodic boundary conditions

u(a) = -u(b)

Solving the eigenproblem:

A u = \lambda u

-i {\d \over \d x} u = \lambda u

u(x) = e^{i\lambda x}

Fourier Series

We restrict our space to periodic functions. Applying the periodic boundary condition:

u(a) = e^{i\lambda a} = u(b) = e^{i\lambda b}

so

e^{i\lambda (b-a)} = 1

\lambda = {2\pi n\over b-a}\quad\quad{\mbox{for $n=0, \pm 1, \pm 2, \dots$}}

The normalized eigenvectors are:

u_n(x) = {1\over\sqrt{b-a}} e^{i {2\pi n\over b-a} x}

These eigenvectors belong to our space and as such all \lambda = {2\pi n\over b-a} form a discrete spectrum. Other solutions do not satisfy the periodic boundary condition and so there is no continous part in the spectrum.

The eigenvectors must be orthogonal, as we can check:

\int_a^b u_n^*(x) u_m(x) \d x =

= \int_a^b
    {1\over\sqrt{b-a}} e^{-i {2\pi n\over b-a} x}
    {1\over\sqrt{b-a}} e^{i {2\pi m\over b-a} x}
    \d x =

= {1\over b-a} \int_a^b
    e^{i {2\pi (m-n)\over b-a} x}
    \d x =

= \begin{cases}
    {1\over b-a} \int_a^b e^{0} \d x & \mbox{for } m = n \\
    {1\over i 2\pi (m-n) } \left[e^{i {2\pi (m-n)\over b-a} x}\right]^b_a &
        \mbox{for } m \ne n \\
  \end{cases} =

= \begin{cases}
    1 & \mbox{for } m = n \\
    {1\over i 2\pi (m-n) } \left(
        e^{i {2\pi (m-n)\over b-a} b}-e^{i {2\pi (m-n)\over b-a} a}\right) &
        \mbox{for } m \ne n \\
  \end{cases} =

= \begin{cases}
    1 & \mbox{for } m = n \\
    {e^{i {2\pi (m-n)\over b-a} a}\over i 2\pi (m-n)} \left(
        e^{i {2\pi (m-n)\over b-a} (b-a)}-1\right) &
        \mbox{for } m \ne n \\
  \end{cases} =

= \begin{cases}
    1 & \mbox{for } m = n \\
    0 & \mbox{for } m \ne n \\
  \end{cases} =
  \delta_{mn}

The eigenvectors must be complete:

\sum_{n=-\infty}^\infty \ket{n}\bra{n} = \one

\sum_{n=-\infty}^\infty \braket{x|n}\braket{n|x'} = \braket{x|x'}

\sum_{n=-\infty}^\infty u_n(x) u_n^*(x') \d x = \delta(x-x')

Any function f(x) can then be expanded on the interval [a, b] into the Fourier series:

f(x) = \braket{x|f} = \sum_{n=-\infty}^\infty \braket{x|n}\braket{n|f}
= \sum_{n=-\infty}^\infty c_n' u_n(x)
= \sum_{n=-\infty}^\infty c_n' {1\over\sqrt{b-a}} e^{i {2\pi n\over b-a} x}
= \sum_{n=-\infty}^\infty c_n e^{i {2\pi n\over b-a} x}

c_n = c_n' {1\over\sqrt{b-a}}
    = \braket{n|f} {1\over\sqrt{b-a}}
    = {1\over\sqrt{b-a}} \int_a^b \braket{n|x}\braket{x|f} \d x
    = {1\over\sqrt{b-a}} \int_a^b u_n^*(x) f(x) \d x
    = {1\over b-a} \int_a^b e^{-i {2\pi n\over b-a} x} f(x) \d x

Equivalently, this can be written using \sin and \cos directly:

f(x)
    = \sum_{n=-\infty}^\infty c_n
        e^{i {2\pi n\over b-a} x} =

    = \sum_{n=-\infty}^\infty c_n
        \cos \left({2\pi n\over b-a} x\right)
    + \sum_{n=-\infty}^\infty i c_n
        \sin \left({2\pi n\over b-a} x\right) =

    = c_0 + \sum_{n=1}^\infty (c_n + c_{-n})
        \cos \left({2\pi n\over b-a} x\right)
    + \sum_{n=1}^\infty i (c_n - c_{-n})
        \sin \left({2\pi n\over b-a} x\right)

By introducing the coefficients a_n and b_n:

a_n &= c_n + c_{-n}      \quad\quad {\mbox{for } n = 0, 1, 2, \dots} \\
b_n &= i(c_n - c_{-n})   \quad\quad {\mbox{for } n = 1, 2, \dots}

we can write the series as:

f(x)
    = {a_0\over 2} + \sum_{n=1}^\infty a_n
        \cos \left({2\pi n\over b-a} x\right)
    + \sum_{n=1}^\infty b_n \sin \left({2\pi n\over b-a} x\right)

we get:

a_n = c_n + c_{-n}
    = {1\over b-a} \int_a^b \left(
        e^{-i {2\pi n\over b-a} x} + e^{i {2\pi n\over b-a} x}\right)
        f(x) \d x
    = {2\over b-a} \int_a^b \cos \left({2\pi n\over b-a} x\right)
        f(x) \d x

b_n = i(c_n - c_{-n})
    = {i\over b-a} \int_a^b \left(
        e^{-i {2\pi n\over b-a} x} - e^{i {2\pi n\over b-a} x}\right)
        f(x) \d x
    = {2\over b-a} \int_a^b \sin \left({2\pi n\over b-a} x\right)
        f(x) \d x

Conceptually, we are taking the complex orthonormal basis u_n(x) = {1\over\sqrt{b-a}} e^{i {2\pi n\over b-a} x} and creating a real orthonormal basis v_n(x) composed of u_0, \Re u_1, \Re u_2, …, \Im u_1, \Im u_2, … as follows:

v_n(x) = \begin{cases}
    \sqrt{2} \Re u_n =  {\sqrt 2\over\sqrt{b-a}}\cos {2\pi\over b-a} n x
        & \mbox{for } n > 0\\
    u_0  = {1\over\sqrt{b-a}}                     & \mbox{for } n = 0\\
    \sqrt{2} \Im u_{|n|} = {\sqrt 2\over\sqrt{b-a}}
        \sin {2\pi\over b-a} |n| x     & \mbox{for } n < 0\\
    \end{cases}

We are only summing over the positive arguments in \sin and \cos, thus the absolute value for n < 0. The basis v_n is orthonormal:

\int_a^b v_n(x) v_m(x) \d x = \delta_{n m}

and complete:

\sum_{n=-\infty}^\infty v_n(x) v_n(x') \d x = \delta(x-x')

This is not the only way to create the real orthonormal basis. In general:

u_n(x) = \braket{x|n}

v_n(x) = \braket{x|n}_R

\ket{n}_R = \sum_m U_{n m} \ket{m}

We require the new basis \ket{n}_R to be orthonormal:

\braket{n|m}_R = \delta_{n m}

\sum_{kl} \braket{k|U^*_{nk} U_{ml} | l} = \delta_{n m}

\sum_{kl} U^*_{nk} U_{ml} \delta_{kl} = \delta_{n m}

\sum_k U^*_{nk} U_{mk} = \delta_{n m}

This restricts the U_{nm} matrices to be unitary (U^{-1} = U^\dag), because:

U U^\dag = \one

(U U^\dag)_{mn} = (\one)_{mn} = \delta_{mn}

\sum_k (U)_{mk} (U^\dag)_{kn} = \delta_{mn}

\sum_k U_{mk} U^*_{nk} = \delta_{mn}

The unitarity condition also makes sure, that the real basis is complete:

\sum_n \ket{n}_R \bra{n}_R
    = \sum_n \sum_{kl} U_{nk} \ket{k}\bra{l} U_{nl}^*
    = \sum_{kl} \delta_{kl} \ket{k}\bra{l}
    = \sum_k \ket{k}\bra{k}
    = \one

Requiring \ket{n}_R to be real and using \ket{m}^* = \ket{-m} we get:

\ket{n}_R^* = \ket{n}_R

\sum_m U_{nm}^* \ket{m}^* = \sum_m U_{nm} \ket{m}

\sum_m U_{nm}^* \ket{-m} = \sum_m U_{nm} \ket{m}

\sum_m U_{n,-m}^* \ket{m} = \sum_m U_{nm} \ket{m}

\sum_m (U_{nm} -U_{n,-m}^*) \ket{m} = 0

U_{nm} = U_{n,-m}^*

U_{nm}^* = U_{n,-m}

Because the basis \ket{m} is complete. So the only conditions on the matrices U_{mn} are:

U^{-1} = U^\dag

U_{nm}^* = U_{n,-m}

They imply that the new basis will be real, orthonormal and complete. Our final restriction is that we want each real basis element to correspond to the same frequency \pm m (possible sign change is ok): this means that we can only mix the same frequencies, i.e.:

U_{nm} = 0\quad\mbox{for } |n| \ne |m|

and also that the nonzero matrix elements can only be of the form R e^{i{\pi\over 2} n} for n=0, 1, 2, 3 (i.e. \pm R or \pm iR for some positive R).

Up to possible sign changes and permutations, this determines the matrix uniquely. Our choice above is:

U_{nm} = \begin{cases}
    {\delta_{nm} + \delta_{n,-m}\over\sqrt{2}}   & \mbox{for } n > 0\\
    \delta_{0m}                                  & \mbox{for } n = 0\\
    {\delta_{nm} - \delta_{n,-m}\over i\sqrt{2}} & \mbox{for } n < 0\\
    \end{cases}

In other words, we get (except that the matrix is infinite):

\begin{pmatrix}
v_3 \\
v_2 \\
v_1 \\
v_0 \\
v_{-1} \\
v_{-2} \\
v_{-3} \\
\end{pmatrix} =
\begin{pmatrix}
{1\over  \sqrt 2} & & & & & &  {1\over  \sqrt2} \\
& {1\over  \sqrt 2} & & & &  {1\over  \sqrt2} & \\
& & {1\over  \sqrt 2} & &  {1\over  \sqrt2} & & \\
& & &                  1                  & & & \\
& & {1\over i\sqrt 2} & & -{1\over i\sqrt2} & & \\
& {1\over i\sqrt 2} & & & & -{1\over i\sqrt2} & \\
{1\over i\sqrt 2} & & & & & & -{1\over i\sqrt2} \\
\end{pmatrix}
    \begin{pmatrix}
    u_3 \\
    u_2 \\
    u_1 \\
    u_0 \\
    u_{-1} \\
    u_{-2} \\
    u_{-3} \\
    \end{pmatrix}

Fourier Transform

Our domain is (-\infty, \infty), so the solution of the eigen problem is:

A u = \lambda u

-i {\d \over \d x} u = \lambda u

u(x) = e^{i\lambda x}

The normalized eigenfunctions are:

u_\lambda(x) = {1\over\sqrt{2\pi}} e^{i\lambda x}

We calculate the normalization:

\int_{-\infty}^\infty u_\lambda^*(x) u_\kappa(x) \d x =

= \int_{-\infty}^\infty
    {1\over\sqrt{2\pi}} e^{-i\lambda x}
    {1\over\sqrt{2\pi}} e^{i\kappa x}
    \d x =

= {1\over 2\pi} \int_{-\infty}^\infty e^{i(\kappa-\lambda) x} \d x =

= \delta(\kappa-\lambda)

So the spectrum is continous. The eigenvectors must be complete:

\int_{-\infty}^\infty \ket{\lambda}\bra{\lambda} \d \lambda = \one

\int_{-\infty}^\infty \braket{x|\lambda}\braket{\lambda|x'} \d \lambda
    = \braket{x|x'}

\int_{-\infty}^\infty u_\lambda(x) u_\lambda^*(x') \d \lambda = \delta(x-x')

Any function f(x) can then be written as:

f(x) = \braket{x|f}
= \int_{-\infty}^\infty \braket{x|\lambda}\braket{\lambda|f} \d \lambda
= \int_{-\infty}^\infty u_\lambda(x) \hat f(\lambda) \d \lambda
= {1\over\sqrt{2\pi}} \int_{-\infty}^\infty e^{i\lambda x}
    \hat f(\lambda) \d \lambda

where \hat f(\lambda) is called the Fourier transform of f(x):

\hat f(\lambda) = \braket{\lambda|f}
= \int_{-\infty}^\infty \braket{\lambda|x}\braket{x|f} \d x
= \int_{-\infty}^\infty u_\lambda^*(x) f(x) \d x
= {1\over\sqrt{2\pi}}\int_{-\infty}^\infty
    e^{-i\lambda x} f(x) \d x

Note that both for Fourier series and Fourier transform, the sign convention in the exponentials (e^{\pm i\lambda x}) follows from choosing the sign in A =
-i {\d \over \d x} and as such it is arbitrary. We can also choose A' = i {\d
\over \d x} and then the sign will be flipped.

3.41.4. Sturm–Liouville Operator

The Sturm-Liouville operator L is:

L u(x)  = {1 \over w(x)} \left(-{\d\over \d x}
    \left(p(x){\d u(x)\over dx}\right) +q(x) u(x) \right)

Everything is real. The scalar product is weighted by w(x). The operator is self-adjoint if:

\int_a^b u(x) L v(x) w(x) \d x = \int_a^b (L u(x)) v(x) w(x) \d x

so

\int_a^b u(x) L v(x) w(x) \d x =

= \int_a^b u(x) {1 \over w(x)} \left(-{\d\over \d x}
    \left(p(x){\d v(x)\over dx}\right) +q(x) v(x) \right)
    w(x) \d x =

= \int_a^b \left(-u(x) {\d\over \d x}
    \left(p(x){\d v(x)\over dx}\right) + u(x) q(x) v(x) \right)
    \d x =

= \int_a^b \left({\d u(x)\over\d x} p(x){\d v(x)\over dx}
    + u(x) q(x) v(x) \right) \d x
      -\left[u(x)p(x){\d v(x)\over dx}\right]^b_a
      =

= \int_a^b \left(-{\d\over \d x} \left(p(x) {\d u(x)\over\d x}\right) v(x)
    + u(x) q(x) v(x) \right) \d x
      -\left[u(x)p(x){\d v(x)\over dx}-{\d u(x)\over dx}p(x)v(x)\right]^b_a
      =

= \int_a^b \left(L u(x)\right) v(x) w(x) \d x
      -\left[u(x)p(x){\d v(x)\over dx}-{\d u(x)\over dx}p(x)v(x)\right]^b_a

And the operator L is self-adjoint if and only if:

\left[u(x)p(x)v'(x)-u'(x)p(x)v(x)\right]^b_a = 0

This condition can be satisfied by various boundary conditions. For example:

  • Dirichlet boundary conditions

u(a) = 0, \quad u(b) = 0

  • Neumann boundary conditions

u'(a) = 0, \quad u'(b) = 0

  • Periodic boundary conditions

u(a)  &= u(b) \\
u'(a) &= u'(b)

  • Antiperiodic boundary conditions

u(a)  &= -u(b) \\
u'(a) &= -u'(b)

or mixtures of these, e.g. Dirichlet at x=a and Neumann at x=b.

Legendre Polynomials

Legendre polynomials P_n(x) are solutions of the Sturm–Liouville problem on the interval [-1, 1] with p(x)=1-x^2, q(x)=0, w(x)=1 and \lambda=n(n+1):

L u(x)  = n(n+1) u(x)

L u(x)  = -{\d\over \d x} \left((1-x^2){\d u(x)\over dx}\right)

The operator L is self-adjoint due to vanishing p(x) at the endpoints:

\left[(u(x)v'(x)-u'(x)v(x))p(x)\right]_{-1}^1
    = \left[(u(x)v'(x)-u'(x)v(x))(1-x^2)\right]_{-1}^1 = 0

We restrict our space to bounded functions. The solutions of the eigenvalue problem for integer n are Legendre polynomials P_n(x), the normalized eigenvectors u_n(x) are:

u_n(x) = \sqrt{2n+1\over 2} P_n(x)

Solutions for non integer n are Legendre functions that are singular at the end points and as such are not solutions that we want. As such, the spectrum is discrete and the Legendre polynomials form a complete orthogonal basis for functions on the interval [-1, 1]:

\int_{-1}^1 u_n(x) u_m(x)
= {2n+1\over 2} \int_{-1}^1 P_n(x) P_m(x)
= \delta_{n m}

\sum_{n=0}^\infty u_n(x) u_n(x')
= {2n+1\over 2} \sum_{n=0}^\infty P_n(x) P_n(x')
= \delta(x-x')

any function f(x) on the interval [-1, 1] can be expanded as:

f(x) = \sum_{n=0}^\infty f_n' u_n(x)
    = \sum_{n=0}^\infty f_n' \sqrt{2n+1\over 2} P_n(x)
    = \sum_{n=0}^\infty f_n P_n(x)

f_n = f_n' \sqrt{2n+1\over 2}
    = \sqrt{2n+1\over 2} \int_{-1}^1 u_n(x) f(x)
    = {2n+1\over 2} \int_{-1}^1 P_n(x) f(x)

3.41.5. Angular Momentum Operator

The angular momentum operators L_1, L_2 and L_3 are given by:

L_j = -i \epsilon_{jkl} x_k \partial_l

in spherical coordinates:

L_1 &= i \left(\sin \phi \ \partial_\theta
     + \cot \theta \cos \phi \ \partial_\phi\right) \\
L_2 &= i \left(-\cos\phi \ \partial_\theta
    + \cot \theta \sin \phi \ \partial_\phi\right) \\
L_3 &= -i \partial_\phi

and

L^2 = L_1^2 + L_2^2 + L_3^2 =
     - \left( {1\over\sin\theta} \partial_\theta
            \left(\sin\theta \ \partial_\theta \right)
     + {1\over \sin^2\theta}\partial_\phi^2\right)

The eigenproblem is:

(3.41.5.1)L^2 \ket{lm} &= l(l+1) \ket{lm} \\
L_3 \ket{lm} &= m \ket{lm}

Using Condon & Shortley phase convention, it can be shown that:

(3.41.5.2)(L_1 \pm i L_2) \ket{l, m} = \sqrt{(l \mp m)(l\pm m + 1)} \ket{l,m \pm 1}

and by repeated application:

(L_1 \pm i L_2)^k \ket{l, m} =

    = \sqrt{(l \mp m)(l \mp m-1)\cdots(l\mp m -k+1)
        (l\pm m + 1)(l\pm m + 2)\cdots(l\mp m + k)} \ket{l,m \pm k} =

    = \sqrt{{(l\mp m)!\over (l\pm m)!} {(l\pm m + k)!\over (l\mp m - k)!}}
        \ket{l,m \pm k}

where

L_1 + i L_2 = i \sin \phi \ \partial_\theta
     + i \cot \theta \cos \phi \ \partial_\phi
    \pm \left(\cos\phi \ \partial_\theta
    - \cot \theta \sin \phi \ \partial_\phi\right) =

= e^{\pm i\phi} \left(\pm \partial_\theta + i \cot\theta \partial_\phi
    \right)

The solution of (3.41.5.1) is of the form:

(3.41.5.3)\braket{\theta \phi | l m} = Y_{lm}(\theta, \phi)
    = \Theta_{lm}(\theta) \Phi_m(\phi)

and we get from (3.41.5.1):

-i {\d\over\d\phi} \Phi_m(\phi) = m \Phi_m(\phi)

on the interval [0, 2 \pi] with the boundary condition \Phi_m(0) =
\Phi_m(2\pi). From Derivative Operator the eigenvalues are all integer m and the normalized eigenvector is:

(3.41.5.4)\Phi_m(\phi) = {1\over\sqrt{2\pi}} e^{im\phi}

Substituting (3.41.5.4) into (3.41.5.3) we get from (3.41.5.1) an ordinary second order differential equation for \Theta_{lm}(\theta):

L^2 \ket{lm} = l(l+1) \ket{lm}

- \left( {1\over\sin\theta} \partial_\theta
            \left(\sin\theta \ \partial_\theta \right)
     + {1\over \sin^2\theta}\partial_\phi^2\right)
    {1\over\sqrt{2\pi}} e^{im\phi} \Theta_{lm}
    = l(l+1) {1\over\sqrt{2\pi}} e^{im\phi} \Theta_{lm}

{1\over\sin\theta} {\d\over\d \theta}
            \left(\sin\theta {\d\over\d \theta} \Theta_{lm}\right)
            +
        \left( l(l+1) - {m^2\over \sin^2\theta} \right) \Theta_{lm} = 0

{\d\over\d \cos\theta} \left((1-\cos^2\theta)
    {\d\over\d \cos \theta} \Theta_{lm}\right)
            +
        \left( l(l+1) - {m^2\over 1-\cos^2\theta} \right) \Theta_{lm} = 0

{\d\over\d z} \left((1-z^2) {\d \Theta_{lm}\over\d z}\right)
    + \left(l (l+1) - {m^2\over 1-z^2}\right)\Theta_{lm} = 0

where

z = \cos\theta

This equation can be solved using the following approach. From (3.41.5.2) we get:

(L_1\pm iL_2)Y_{lm}(\theta, \phi)
= (L_1\pm iL_2)\Theta_{lm}(\theta)\Phi_m(\phi) =

= e^{\pm i\phi} \left(\pm \partial_\theta + i \cot\theta \partial_\phi
    \right) \Theta_{lm}(\theta) {1\over\sqrt{2\pi}} e^{im\phi} =

= {1\over\sqrt{2\pi}} e^{i(m\pm1)\phi}
    \left(\pm {\d\over\d \theta} -m \cot\theta \right) \Theta_{lm}(\theta) =

= \mp {1\over\sqrt{2\pi}} e^{i(m\pm1)\phi}
    \left(\sin\theta {\d\over\d \cos \theta} \mp m
        {\d\sin\theta\over\d \cos\theta} \right) \Theta_{lm}(\theta) =

= \mp {1\over\sqrt{2\pi}} e^{i(m\pm1)\phi}
    \sin^{1\pm m}\theta \left({\d\over\d \cos \theta}
    \sin^{\mp m}\theta\ \Theta_{lm}(\theta) \right) =

= \mp \Phi_{m\pm 1}(\phi)
    \sin^{1\pm m}\theta \left({\d\over\d \cos \theta}
    \sin^{\mp m}\theta\ \Theta_{lm}(\theta) \right)

and by repeated application we get:

(L_1\pm iL_2)^k Y_{lm}(\theta, \phi)
= (\mp 1)^k \Phi_{m\pm k}(\phi)
    \sin^{k\pm m}\theta \left({\d^k\over(\d \cos \theta)^k}
    \sin^{\mp m}\theta\ \Theta_{lm}(\theta) \right) =

= \sqrt{{(l\mp m)!\over (l\pm m)!} {(l\pm m + k)!\over (l\mp m - k)!}}
    \Phi_{m \pm k}(\phi) \Theta_{l,m\pm k}(\theta)

from which we obtain:

(3.41.5.5)\Theta_{l,m\pm k}(\theta) =
    \sqrt{{(l\pm m)!\over (l\mp m)!} {(l\mp m - k)!\over (l\pm m + k)!}}
        (\mp 1)^k
    \sin^{k\pm m}\theta \left({\d^k\over(\d \cos \theta)^k}
    \sin^{\mp m}\theta\ \Theta_{lm}(\theta) \right)

As a special case for m=0 and k=m>0 we get:

(3.41.5.6)\Theta_{l,\pm m}(\theta) =
        (\mp 1)^m
    \sqrt{{(l - m)!\over (l + m)!}}
    \sin^{m}\theta \left({\d^m\over(\d \cos \theta)^m}
    \Theta_{l0}(\theta) \right)

and for m=l and k=l-m we get (we only use the \Theta_{l,m- k} branch):

(3.41.5.7)\Theta_{lm}(\theta) =
\Theta_{l,l-(l-m)}(\theta) =

    = \sqrt{{(l- l)!\over (l+ l)!} {(l+ l - (l-m))!\over (l- l +
    l-m)!}}
        (+ 1)^{l-m}
    \sin^{l-m- l}\theta \left({\d^{l-m}\over(\d \cos \theta)^{l-m}}
    \sin^{+ l}\theta\ \Theta_{ll}(\theta) \right) =

    = \sqrt{{1\over (2l)!} {(l+m)!\over (l-m)!}}
    {1\over\sin^m\theta} \left({\d^{l-m}\over(\d \cos \theta)^{l-m}}
    \sin^l\theta\ \Theta_{ll}(\theta) \right)

From (3.41.5.2) we get:

(L_1 + i L_2) Y_{ll}
    = \sqrt{(l - l)(l + l + 1)} Y_{ll} = 0

Using (3.41.5.4) this gives us a first order differential equation:

(L_1 + i L_2) \Theta_{ll} \Phi_l = 0

e^{i\phi} \left(\partial_\theta + i \cot\theta \partial_\phi
    \right) \Theta_{ll} {1\over\sqrt{2\pi}} e^{i l\phi} = 0

{\partial \Theta_{ll}\over\partial \theta} - l \cot \theta \ \Theta_{ll} = 0

from which

(3.41.5.8)\Theta_{ll}(\theta) = (-1)^l \sqrt{(2l+1)!\over 2} {1\over 2^l l!}
    \sin^l \theta

It is normalized as:

\int_0^\pi \Theta_{ll}^2 \sin\theta\ \d\theta = 1

We used the value of the integral:

\int_0^\pi \sin^{2l+1}\theta\ \d\theta = {\sqrt\pi\ \Gamma(l+1)
    \over \Gamma(l+{3\over2})}
 = {\sqrt\pi\  2^{l+1} l! \over (2l+1)!! \sqrt\pi}
 = {2^{l+1} l! \over (2l+1)!!}
 = {2^{2l+2} (l+1)! l! \over (2l+2)!} =

 = {(2^{l+1} l!)^2 (l+1) \over (2l+2)!}
 = {4 (2^l l!)^2 (l+1) \over (2l+1)! 2 (l+1)}
 = {2 (2^l l!)^2 \over (2l+1)!}

Using (3.41.5.8) in (3.41.5.7) we get:

\Theta_{lm}(\theta)
    = (-1)^l \sqrt{{2l+1\over 2}{(l+m)!\over (l-m)!}}
    {1\over 2^l l!}
    {1\over\sin^m\theta} {\d^{l-m}\over(\d \cos \theta)^{l-m}}
    \sin^{2l}\theta

for m=0 we obtain:

\Theta_{l0}(\theta)
    = (-1)^l \sqrt{{2l+1\over 2}}
    {1\over 2^l l!}
    {\d^l\over(\d \cos \theta)^l}
    \sin^{2l}\theta =

    = \sqrt{{2l+1\over 2}}
    {1\over 2^l l!}
    {\d^l\over(\d \cos \theta)^l}
    (\cos^2\theta-1)^l =

    = \sqrt{{2l+1\over 2}} P_l(\cos\theta)

where

P_l(z) = {1\over 2^l l!} {\d^l\over\d z^l} (z^2-1)^l

is the Rodrigues’ formula for Legendre polynomials. We substitute \Theta_{l0} into (3.41.5.6) and get:

(3.41.5.9)\Theta_{l,\pm m}(\theta) =
        (\mp 1)^m
    \sqrt{{2l+1\over 2}{(l - m)!\over (l + m)!}}
    \sin^{m}\theta \left({\d^m\over(\d \cos \theta)^m}
    P_l(\cos\theta) \right)

Hence \Theta_{lm} = (-1)^m \Theta_{l,-m}. Using associated Legendre polynomials, we can write:

(3.41.5.10)\Theta_{lm}(\theta) = \sqrt{{2l+1\over 2}{(l-m)!\over (l+m)!}}
    P_l^m(\cos \theta)

where (for all m):

P_l^m(\cos \theta)
= (-1)^l {(l+m)!\over (l-m)!} {1\over 2^l l!}
{1\over\sin^m\theta} {\d^{l-m}\over(\d \cos \theta)^{l-m}}
\sin^{2l}\theta =

= {(l+m)!\over (l-m)!} {1\over 2^l l!}
{1\over\sin^m\theta} {\d^{l-m}\over(\d \cos \theta)^{l-m}}
(\cos^2\theta-1)^l =

= (-1)^m {1\over 2^l l!}
{(1-\cos^2)^m\theta\over\sin^m\theta}
    {\d^{l+m}\over(\d \cos \theta)^{l+m}}
(\cos^2\theta-1)^l =

= (-1)^m {1\over 2^l l!}
\sin^m\theta {\d^{l+m}\over(\d \cos \theta)^{l+m}}
(\cos^2\theta-1)^l =

= (-1)^m {1\over 2^l l!}
(1-z^2)^{m\over 2} {\d^{l+m}\over \d z^{l+m}} (z^2-1)^l

hence (comparing the second and fourth equation above):

(3.41.5.11)P^{-m}_l(z) = (-1)^m {(l-m)!\over (l+m)!} P_l^m(z)

This is valid for all m (positive or negative). For m \ge 0 we get from (3.41.5.9) and (3.41.5.11):

P_l^{m}(\cos \theta) =
    (-1)^m
\sin^{m}\theta {\d^m\over(\d \cos \theta)^m} P_l(\cos\theta)

P_l^{-m}(\cos \theta) = {(l-m)!\over (l+m)!}
\sin^{m}\theta {\d^m\over(\d \cos \theta)^m} P_l(\cos\theta)

P_l^{m}(z) =
    (-1)^m
(1-z^2)^{m\over2} {\d^m\over\d z^m} P_l(z)

P_l^{-m}(z) = {(l-m)!\over (l+m)!}
(1-z^2)^{m\over2} {\d^m\over\d z^m} P_l(z)

This is usually used as the definition of the associated Legendre polynomials. They include the Condon & Shortley phase factor (-1)^m (only for positive m). Some authors omit it (then it needs to be included in the equation (3.41.5.10)). Note that (3.41.5.10) for m<0 can be also written as:

\Theta_{lm}(\theta)
    = \sqrt{{2l+1\over 2}{(l-m)!\over (l+m)!}} P_l^m(\cos \theta)
    = \sqrt{{2l+1\over 2}{(l+m)!\over (l-m)!}} {(l-m)!\over (l+m)!}
        P_l^m(\cos \theta) =

    = (-1)^m \sqrt{{2l+1\over 2}{(l+m)!\over (l-m)!}} P_l^{-m}(\cos \theta)
    = (-1)^m \sqrt{{2l+1\over 2}{(l-|m|)!\over (l+|m|)!}} P_l^{|m|}
        (\cos \theta)

Thanks to

i^{m-|m|} = \begin{cases}
    1      & \mbox{for } m \ge 0\\
    (-1)^m & \mbox{for } m < 0\\
    \end{cases}

we can write for all m:

\Theta_{lm}(\theta)
    = \sqrt{{2l+1\over 2}{(l-m)!\over (l+m)!}} P_l^m(\cos \theta)
    = i^{m-|m|} \sqrt{{2l+1\over 2}{(l-|m|)!\over (l+|m|)!}}
        P_l^{|m|}(\cos \theta)

The normalization of associated Legendre polynomials is:

\int_{-1}^1 \Theta_{lm}(\theta) \Theta_{l' m}(\theta)
    \sin\theta \d \theta
    = \delta_{l l'}

\int_{-1}^1 P_l^m(x) P_{l'}^m(x) \d x = {2\over 2l+1} {(l+m)!\over(l-m)!}
    \delta_{l l'}

Finally, we get (for all m):

Y_{lm}(\theta, \phi)
    = \Theta_{lm}(\theta) \Phi_m(\phi)
    = \sqrt{{2l+1\over 4\pi}{(l-m)!\over (l+m)!}}
    P_l^m(\cos \theta) e^{im\phi} =

    = i^{m-|m|} \sqrt{{2l+1\over 4\pi}{(l-|m|)!\over (l+|m|)!}}
    P_l^{|m|}(\cos \theta) e^{im\phi} =

    = (-1)^m i^{m+|m|} \sqrt{{2l+1\over 4\pi}{(l-|m|)!\over (l+|m|)!}}
    P_l^{|m|}(\cos \theta) e^{im\phi}

Any function on the sphere can be expanded as:

f(\theta, \phi) = \braket{\theta \phi | f}
= \sum_{l=0}^\infty \sum_{m=-l}^l \braket{\theta \phi|l m}
    \braket{l m | f}
= \sum_{l=0}^\infty \sum_{m=-l}^l Y_{lm}(\theta, \phi)
    f_{l m}

f_{lm} = \braket{l m | f}
= \int \braket{l m | \Omega} \braket{\Omega | f} \d\Omega =

= \int_0^{2\pi}\d\phi \int_0^\pi \d\theta
    \braket{l m | \theta \phi} \braket{\theta \phi | f} \sin \theta
= \int_0^{2\pi}\d\phi \int_0^\pi \d\theta \
    Y_{lm}^*(\theta, \phi) f(\theta, \phi)  \sin \theta

Real Spherical Harmonics

The most obvious approach is to use a similar way as for Fourier series. We rearrange the sum:

f(\theta, \phi)
= \sum_{l=0}^\infty \sum_{m=-l}^l Y_{lm}(\theta, \phi)
    f_{l m}
= \sum_{l=0}^\infty \sum_{m=-l}^l \Theta_{lm}(\theta, \phi)
    {1\over\sqrt {2\pi}} e^{im\phi}
    f_{l m} =

= {1\over\sqrt {2\pi}}
\sum_{l=0}^\infty \sum_{m=-l}^l
    \left(
        \Theta_{lm}(\theta, \phi)
        \cos m \phi
        f_{l m}
    +
        \Theta_{lm}(\theta, \phi)
        i \sin m \phi
    f_{l m} \right) =

= {1\over\sqrt {2\pi}}
\sum_{l=0}^\infty
    \left(
    \Theta_{l0}(\theta, \phi) f_{l 0}
    +
    \sum_{m=1}^l \left(
        (
        \Theta_{lm}(\theta, \phi)
        f_{l m}
        +
        \Theta_{l,-m}(\theta, \phi)
        f_{l, -m})
        \cos m \phi
    +
        i(
        \Theta_{lm}(\theta, \phi)
        f_{l m}
        -
        \Theta_{l,-m}(\theta, \phi)
        f_{l, -m})
         \sin m \phi
     \right)\right) =

= {1\over\sqrt {2\pi}}
\sum_{l=0}^\infty
    \left(
    \Theta_{l0}(\theta, \phi) f_{l 0}
    +
    \sum_{m=1}^l  \left(
        \Theta_{lm}(\theta, \phi)
        ( f_{l m} + (-1)^m f_{l, -m}) \cos m \phi
    +
        \Theta_{lm}(\theta, \phi)
        i(f_{lm} - (-1)^m f_{l, -m}) \sin m \phi
     \right)\right) =

= {1\over\sqrt {2\pi}}
\sum_{l=0}^\infty
    \left(
    \Theta_{l0}(\theta, \phi) f_{l 0}
    +
    \sum_{m=1}^l  \left(
        \Theta_{lm}(\theta, \phi)
        {f_{l m} + (-1)^m f_{l, -m}\over \sqrt 2} \sqrt 2 \cos m \phi
    +
        \Theta_{lm}(\theta, \phi)
        i{ f_{lm} - (-1)^m f_{l, -m}\over \sqrt 2} \sqrt 2 \sin m \phi
     \right)\right) =

= {1\over\sqrt {2\pi}}
\sum_{l=0}^\infty
    \left(
    \Theta_{l0}(\theta, \phi) \tilde f_{l 0}
    +
    \sum_{m=1}^l  \left(
        \Theta_{lm}(\theta, \phi)
        \tilde f_{l m} \sqrt 2 \cos m \phi
    +
        \Theta_{lm}(\theta, \phi)
        \tilde f_{l, -m} \sqrt 2 \sin m \phi
     \right)\right) =

= {1\over\sqrt {2\pi}}
\sum_{l=0}^\infty
    \left(
    \Theta_{l0}(\theta, \phi) \tilde f_{l 0}
    +
    \sum_{m=1}^l
        \Theta_{lm}(\theta, \phi)
        \tilde f_{l m} \sqrt 2 \cos m \phi
    +\sum_{m=-l}^{-1}
        \Theta_{l|m|}(\theta, \phi)
        \tilde f_{lm} \sqrt 2 \sin |m| \phi
     \right) =

= \sum_{l=0}^\infty \sum_{m=-l}^l Z_{lm}(\theta, \phi)
    \tilde f_{l m}

Where the real spherical harmonics Z_{lm} are:

Z_{lm}(\theta, \phi) = \begin{cases}
    \sqrt{2} {\Theta_{lm}\over\sqrt{2\pi}} \cos m \phi & \mbox{for } m > 0\\
    {\Theta_{l0}\over\sqrt{2\pi}} & \mbox{for } m = 0\\
    \sqrt{2} {\Theta_{l |m|}\over\sqrt{2\pi}} \sin |m| \phi
        & \mbox{for } m < 0\\
  \end{cases}
=
\begin{cases}
    \sqrt{2} \Re(Y_{lm}(\theta, \phi))\\
    Y_{l0}(\theta, \phi) \\
    \sqrt{2} \Im(Y_{l |m|}(\theta, \phi))\\
  \end{cases}
=
\begin{cases}
    {1\over\sqrt{2}}(Y_{lm}(\theta, \phi) + Y_{lm}^*(\theta, \phi))\\
    Y_{l0}(\theta, \phi) \\
    {1\over i\sqrt{2}} (Y_{l |m|}(\theta, \phi) -Y_{l|m|}^*(\theta, \phi))\\
  \end{cases}

and the coefficients \tilde f_{lm} are:

\tilde f_{lm} = \begin{cases}
    {f_{l m} + (-1)^m f_{l, -m}\over \sqrt 2} & \mbox{for } m > 0\\
    f_{l0} & \mbox{for } m = 0\\
    i{ f_{l,-m} - (-1)^m f_{lm}\over \sqrt 2} & \mbox{for } m < 0\\
  \end{cases}
=
\begin{cases}
    \int {Y_{lm}^*+(-1)^m Y_{l,-m}^*\over\sqrt2} f \d\Omega \\
    \int Y_{l0}^* f \d\Omega \\
    \int i{Y_{l,-m}^*-(-1)^m Y_{lm}^*\over\sqrt2} f \d\Omega \\
  \end{cases}

=
\begin{cases}
    \int {Y_{lm}^*+ Y_{lm}\over\sqrt2} f \d\Omega \\
    \int Y_{l0} f \d\Omega \\
    \int {Y_{l, -m}-Y_{l, -m}^*\over i\sqrt2} f \d\Omega \\
  \end{cases}
=
\begin{cases}
    \int {Y_{lm}^*+ Y_{lm}\over\sqrt2} f \d\Omega \\
    \int Y_{l0} f \d\Omega \\
    \int {Y_{l |m|}-Y_{l |m|}^*\over i\sqrt2} f \d\Omega \\
  \end{cases}
=
    \int Z_{lm} f \d\Omega

The factor \sqrt{2} in the definition makes the real spherical harmonics properly normalized:

\int Z_{l m}(\theta, \phi) Z_{l' m'}(\theta, \phi) \d \Omega
    =\delta_{l l'} \delta_{m m'}

From the above derivation, it is not immediately clear how to obtain other parametrizations of real spherical harmonics. And also what identities they obey. More systematic approach is to use the transformation matrices just like for the Fourier series:

Z_{l\mu}(\theta, \phi) = \braket{\theta\phi|l\mu}_R
    = \sum_{m=-l}^l U^l_{\mu m} Y_{lm}(\theta, \phi)
    = \sum_{m=-l}^l U^l_{\mu m} \braket{\theta \phi | lm}

\ket{l\mu}_R = \sum_{m=-l}^l U^l_{\mu m} \ket{lm}

We require orthonormality:

\braket{l\mu | l\mu'}_R = \delta_{\mu \mu'}

This implies unitarity of the U^l matrices for the given l. Requiring \ket{l\mu}_R to be real and using \ket{lm}^* = (-1)^m \ket{l,-m} we get:

\ket{l\mu}_R^* = \ket{l\mu}_R

\sum_m (U^l_{\mu m})^* \ket{lm}^* = \sum_m U^l_{\mu m} \ket{lm}

\sum_m (U^l_{\mu m})^* (-1)^m \ket{l,-m} = \sum_m U^l_{\mu m} \ket{lm}

\sum_m (U^l_{\mu, -m})^* (-1)^m \ket{lm} = \sum_m U^l_{\mu m} \ket{lm}

\sum_m (U^l_{\mu m} - (U^l_{\mu, -m})^*) (-1)^m) \ket{lm} = 0

U^l_{\mu m} = (-1)^m (U^l_{\mu, -m})^*

(U^l_{\mu m})^* = (-1)^m U^l_{\mu, -m}

As for Fourier series, we require not to mix frequencies and phases, so we get:

U_{nm}^l = 0\quad\mbox{for } |n| \ne |m|

and also that the nonzero matrix elements can only be of the form R e^{i{\pi\over 2} n} for n=0, 1, 2, 3 (i.e. \pm R or \pm iR for some positive R). Up to signs and permutations, this determines the matrices uniquely. As for Fourier series, this implies orthonormality and completeness of the real spherical harmonics:

\braket{l' m' | l m}_R = \delta_{ll'} \delta_{mm'}

\sum_{l=0}^\infty \sum_{m=-l}^l \ket{lm}_R \bra{lm}_R = \one

Also, thanks to unitarity we get:

\sum_{m=-l}^l Z_{lm}(\Omega) Z_{lm}(\Omega')
= \sum_{m=-l}^l \sum_{m' m''} U^l_{m m'} Y_{lm'}(\Omega)
    (U^l_{m m''})^* Y_{lm''}^*(\Omega')
= \sum_{m' m''} \delta_{m' m''} Y_{lm'}(\Omega) Y_{lm''}^*(\Omega') =

= \sum_{m=-l}^l Y_{lm}(\Omega) Y^*_{lm}(\Omega')
= {2l+1\over 4\pi} P_l(\cos \gamma)

and

{1\over |{\bf r}-{\bf r'}|}
    =\sum_{l=0}^\infty{r_{<}^l\over r_{>}^{l+1}} P_l({\bf\hat r}\cdot {\bf\hat r'})
    = \sum_{lm}{r_{<}^l\over r_{>}^{l+1}}
        {4\pi\over 2l+1}Y_{lm}({\bf\hat r})Y_{lm}^*({\bf\hat r}')
    = \sum_{lm}{r_{<}^l\over r_{>}^{l+1}}
        {4\pi\over 2l+1}Z_{lm}({\bf\hat r})Z_{lm}({\bf\hat r}')

Following the Fourier series, the most natural way to choose the signs in the U^l matrices is such so as to keep \sin and \cos in the basis with positive frequencies (thus the absolute value for m<0):

Z_{lm}(\theta, \phi)
=
\begin{cases}
    \sqrt{2} \Re(Y_{lm}(\theta, \phi)) & \mbox{for } m > 0\\
    Y_{l0}(\theta, \phi) & \mbox{for } m = 0\\
    \sqrt{2} \Im(Y_{l|m|}(\theta, \phi)) & \mbox{for } m < 0\\
  \end{cases}
=
\begin{cases}
    {1\over\sqrt{2}}(Y_{lm}(\theta, \phi) + Y_{lm}^*(\theta, \phi))\\
    Y_{l0}(\theta, \phi) \\
    {1\over i\sqrt{2}} (Y_{l|m|}(\theta, \phi) - Y_{l|m|}^*(\theta, \phi))\\
  \end{cases}
=

=
\begin{cases}
    {1\over\sqrt{2}}(Y_{lm}(\theta, \phi) + Y_{lm}^*(\theta, \phi))\\
    Y_{l0}(\theta, \phi) \\
    {-(-1)^m\over i\sqrt{2}} (Y_{lm}(\theta, \phi)
        - Y_{lm}^*(\theta, \phi))\\
  \end{cases}
=
\begin{cases}
    {1\over\sqrt{2}}(Y_{lm}(\theta, \phi) + (-1)^m Y_{l,-m}(\theta, \phi))\\
    Y_{l0}(\theta, \phi) \\
    {1\over i\sqrt{2}} (Y_{l,-m}(\theta, \phi)
        - (-1)^m Y_{lm}(\theta, \phi))\\
  \end{cases}
=

=
\begin{cases}
    \sqrt{{2l+1\over 2\pi}{(l-m)!\over (l+m)!}} P_l^m(\cos\theta)
        \cos m\phi \\
    \sqrt{2l+1\over 4\pi} P_l(\cos\theta) \\
    \sqrt{{2l+1\over 2\pi}{(l-|m|)!\over (l+|m|)!}} P_l^{|m|}(\cos\theta)
        \sin |m| \phi \\
  \end{cases}

This gives:

U_{\mu m}^l = \begin{cases}
    {\delta_{\mu m} + (-1)^m \delta_{\mu,-m}\over\sqrt{2}}
        & \mbox{for } \mu > 0\\
    \delta_{0m}                                  & \mbox{for } \mu = 0\\
    {\delta_{\mu,-m} - (-1)^m \delta_{\mu m}\over i\sqrt{2}}
        & \mbox{for } \mu < 0\\
    \end{cases}

Other convention

Some people use the following convention:

Z_{lm}(\theta, \phi)
=
\begin{cases}
    (-1)^m \sqrt{2} \Re(Y_{lm}(\theta, \phi)) & \mbox{for } m > 0\\
    Y_{l0}(\theta, \phi) & \mbox{for } m = 0\\
    (-1)^m \sqrt{2} \Im(Y_{l|m|}(\theta, \phi)) & \mbox{for } m < 0\\
  \end{cases}
=
\begin{cases}
    {1\over\sqrt{2}}((-1)^m Y_{lm}(\theta, \phi) + Y_{l,-m}(\theta, \phi))\\
    Y_{l0}(\theta, \phi) \\
    {1\over i\sqrt{2}} ((-1)^m Y_{l,-m}(\theta, \phi)
        - Y_{lm}(\theta, \phi))\\
  \end{cases}
=

=
\begin{cases}
    (-1)^m \sqrt{{2l+1\over 2\pi}{(l-m)!\over (l+m)!}} P_l^m(\cos\theta)
        \cos m\phi \\
    \sqrt{2l+1\over 4\pi} P_l(\cos\theta) \\
    (-1)^m \sqrt{{2l+1\over 2\pi}{(l-|m|)!\over (l+|m|)!}}
        P_l^{|m|}(\cos\theta) \sin |m| \phi \\
  \end{cases}

It has the advantage that there are no minus signs in the final expressions using \sin, \cos or using x, y, z. However, we will not use this convention.

Tables

Spherical harmonics:

Y_{0,0}(\theta, \phi) = \frac{1}{2 \sqrt{\pi}}

Y_{1,-1}(\theta, \phi) = \frac{\sqrt{6} e^{- \mathbf{\imath} \phi} \sin{\left (\theta \right )}}{4 \sqrt{\pi}}

Y_{1,0}(\theta, \phi) = \frac{\sqrt{3} \cos{\left (\theta \right )}}{2 \sqrt{\pi}}

Y_{1,1}(\theta, \phi) = - \frac{\sqrt{6} e^{\mathbf{\imath} \phi} \sin{\left (\theta \right )}}{4 \sqrt{\pi}}

Y_{2,-2}(\theta, \phi) = \frac{\sqrt{30} e^{- 2 \mathbf{\imath} \phi} \sin^{2}{\left (\theta \right )}}{8 \sqrt{\pi}}

Y_{2,-1}(\theta, \phi) = \frac{\sqrt{30} e^{- \mathbf{\imath} \phi} \sin{\left (\theta \right )} \cos{\left (\theta \right )}}{4 \sqrt{\pi}}

Y_{2,0}(\theta, \phi) = \frac{\sqrt{5} \left(\frac{3}{2} \cos^{2}{\left (\theta \right )} - \frac{1}{2}\right)}{2 \sqrt{\pi}}

Y_{2,1}(\theta, \phi) = - \frac{\sqrt{30} e^{\mathbf{\imath} \phi} \sin{\left (\theta \right )} \cos{\left (\theta \right )}}{4 \sqrt{\pi}}

Y_{2,2}(\theta, \phi) = \frac{\sqrt{30} e^{2 \mathbf{\imath} \phi} \sin^{2}{\left (\theta \right )}}{8 \sqrt{\pi}}

Y_{3,-3}(\theta, \phi) = \frac{\sqrt{35} e^{- 3 \mathbf{\imath} \phi} \sin^{3}{\left (\theta \right )}}{8 \sqrt{\pi}}

Y_{3,-2}(\theta, \phi) = \frac{\sqrt{210} e^{- 2 \mathbf{\imath} \phi} \sin^{2}{\left (\theta \right )} \cos{\left (\theta \right )}}{8 \sqrt{\pi}}

Y_{3,-1}(\theta, \phi) = - \frac{\sqrt{21} \left(6 \sin^{4}{\left (\theta \right )} - 24 \sin^{2}{\left (\theta \right )} \cos^{2}{\left (\theta \right )}\right) e^{- \mathbf{\imath} \phi}}{48 \sqrt{\pi} \sin{\left (\theta \right )}}

Y_{3,0}(\theta, \phi) = \frac{\sqrt{7} \left(- \frac{3}{2} \sin^{2}{\left (\theta \right )} \cos{\left (\theta \right )} + \cos^{3}{\left (\theta \right )}\right)}{2 \sqrt{\pi}}

Y_{3,1}(\theta, \phi) = - \frac{\sqrt{21} \left(360 \cos^{2}{\left (\theta \right )} -72\right) e^{\mathbf{\imath} \phi} \sin{\left (\theta \right )}}{576 \sqrt{\pi}}

Y_{3,2}(\theta, \phi) = \frac{\sqrt{210} e^{2 \mathbf{\imath} \phi} \sin^{2}{\left (\theta \right )} \cos{\left (\theta \right )}}{8 \sqrt{\pi}}

Y_{3,3}(\theta, \phi) = - \frac{\sqrt{35} e^{3 \mathbf{\imath} \phi} \sin^{3}{\left (\theta \right )}}{8 \sqrt{\pi}}

Real spherical harmonics:

Z_{0,0}(\theta, \phi) = \frac{1}{2 \sqrt{\pi}}

Z_{1,-1}(\theta, \phi) = - \frac{\sqrt{3} \sin{\left (\phi \right )} \sin{\left (\theta \right )}}{2 \sqrt{\pi}}

Z_{1,0}(\theta, \phi) = \frac{\sqrt{3} \cos{\left (\theta \right )}}{2 \sqrt{\pi}}

Z_{1,1}(\theta, \phi) = - \frac{\sqrt{3} \sin{\left (\theta \right )} \cos{\left (\phi \right )}}{2 \sqrt{\pi}}

Z_{2,-2}(\theta, \phi) = \frac{\sqrt{15} \sin{\left (2 \phi \right )} \sin^{2}{\left (\theta \right )}}{4 \sqrt{\pi}}

Z_{2,-1}(\theta, \phi) = - \frac{\sqrt{15} \sin{\left (\phi \right )} \sin{\left (\theta \right )} \cos{\left (\theta \right )}}{2 \sqrt{\pi}}

Z_{2,0}(\theta, \phi) = \frac{\sqrt{5} \left(\frac{3}{2} \cos^{2}{\left (\theta \right )} - \frac{1}{2}\right)}{2 \sqrt{\pi}}

Z_{2,1}(\theta, \phi) = - \frac{\sqrt{15} \sin{\left (\theta \right )} \cos{\left (\phi \right )} \cos{\left (\theta \right )}}{2 \sqrt{\pi}}

Z_{2,2}(\theta, \phi) = \frac{\sqrt{15} \sin^{2}{\left (\theta \right )} \cos{\left (2 \phi \right )}}{4 \sqrt{\pi}}

Z_{3,-3}(\theta, \phi) = - \frac{\sqrt{70} \sin{\left (3 \phi \right )} \sin^{3}{\left (\theta \right )}}{8 \sqrt{\pi}}

Z_{3,-2}(\theta, \phi) = \frac{\sqrt{105} \sin{\left (2 \phi \right )} \sin^{2}{\left (\theta \right )} \cos{\left (\theta \right )}}{4 \sqrt{\pi}}

Z_{3,-1}(\theta, \phi) = - \frac{\sqrt{42} \left(360 \cos^{2}{\left (\theta \right )} -72\right) \sin{\left (\phi \right )} \sin{\left (\theta \right )}}{576 \sqrt{\pi}}

Z_{3,0}(\theta, \phi) = \frac{\sqrt{7} \left(- \frac{3}{2} \sin^{2}{\left (\theta \right )} \cos{\left (\theta \right )} + \cos^{3}{\left (\theta \right )}\right)}{2 \sqrt{\pi}}

Z_{3,1}(\theta, \phi) = - \frac{\sqrt{42} \left(360 \cos^{2}{\left (\theta \right )} -72\right) \sin{\left (\theta \right )} \cos{\left (\phi \right )}}{576 \sqrt{\pi}}

Z_{3,2}(\theta, \phi) = \frac{\sqrt{105} \sin^{2}{\left (\theta \right )} \cos{\left (2 \phi \right )} \cos{\left (\theta \right )}}{4 \sqrt{\pi}}

Z_{3,3}(\theta, \phi) = - \frac{\sqrt{70} \sin^{3}{\left (\theta \right )} \cos{\left (3 \phi \right )}}{8 \sqrt{\pi}}

Real spherical harmonics (using x, y and z, assuming x^2 + y^2 + z^2 = 1):

Z_{0,0}(x, y, z) = \frac{1}{2 \sqrt{\pi}}

Z_{1,-1}(x, y, z) = - \frac{\sqrt{3} y}{2 \sqrt{\pi}}

Z_{1,0}(x, y, z) = \frac{\sqrt{3} z}{2 \sqrt{\pi}}

Z_{1,1}(x, y, z) = - \frac{\sqrt{3} x}{2 \sqrt{\pi}}

Z_{2,-2}(x, y, z) = \frac{\sqrt{15} x y}{2 \sqrt{\pi}}

Z_{2,-1}(x, y, z) = - \frac{\sqrt{15} y z}{2 \sqrt{\pi}}

Z_{2,0}(x, y, z) = \frac{\sqrt{5} \left(3 z^{2} -1\right)}{4 \sqrt{\pi}}

Z_{2,1}(x, y, z) = - \frac{\sqrt{15} x z}{2 \sqrt{\pi}}

Z_{2,2}(x, y, z) = \frac{\sqrt{15} \left(x^{2} - y^{2}\right)}{4 \sqrt{\pi}}

Z_{3,-3}(x, y, z) = \frac{\sqrt{70} y \left(- 3 x^{2} + y^{2}\right)}{8 \sqrt{\pi}}

Z_{3,-2}(x, y, z) = \frac{\sqrt{105} x y z}{2 \sqrt{\pi}}

Z_{3,-1}(x, y, z) = \frac{\sqrt{42} y \left(- 5 z^{2} + 1\right)}{8 \sqrt{\pi}}

Z_{3,0}(x, y, z) = \frac{\sqrt{7} z \left(5 z^{2} -3\right)}{4 \sqrt{\pi}}

Z_{3,1}(x, y, z) = \frac{\sqrt{42} x \left(- 5 z^{2} + 1\right)}{8 \sqrt{\pi}}

Z_{3,2}(x, y, z) = \frac{\sqrt{105} z \left(x^{2} - y^{2}\right)}{4 \sqrt{\pi}}

Z_{3,3}(x, y, z) = \frac{\sqrt{70} x \left(- x^{2} + 3 y^{2}\right)}{8 \sqrt{\pi}}

These tables were generated using spherical_harmonics.py:

from sympy import (sympify, factorial, var, cos, S, sin, Dummy, sqrt, pi, exp,
        I, latex, symbols)

def Plm(l, m, z):
    """
    Returns the associated Legendre polynomial P_{lm}(z).

    The Condon & Shortley (-1)^m factor is included.
    """
    l = sympify(l)
    m = sympify(m)
    z = sympify(z)
    if m >= 0:
        r = ((z**2-1)**l).diff(z, l+m)
        return (-1)**m * (1-z**2)**(m/2) * r / (2**l * factorial(l))
    else:
        m = -m
        r = ((z**2-1)**l).diff(z, l+m)
        return factorial(l-m)/factorial(l+m) * (1-z**2)**(m/2) * r / (2**l * factorial(l))


def Plm_cos(l, m, theta):
    """
    Returns the associated Legendre polynomial P_{lm}(cos(theta)).

    The Condon & Shortley (-1)^m factor is included.
    """
    l = sympify(l)
    m = sympify(m)
    theta = sympify(theta)
    z = Dummy("z")
    r = ((z**2-1)**l).diff(z, l+m).subs(z**2-1, -sin(theta)**2).subs(z, cos(theta))
    return (-1)**m * sin(theta)**m * r / (2**l * factorial(l))

def Ylm(l, m, theta, phi):
    """
    Returns the spherical harmonics Y_{lm}(theta, phi) using the Condon & Shortley convention.
    """
    l, m, theta, phi = sympify(l), sympify(m), sympify(theta), sympify(phi)
    return sqrt((2*l+1)/(4*pi) * factorial(l-m)/factorial(l+m)) * Plm_cos(l, m, theta) * exp(I*m*phi)

def Zlm(l, m, theta, phi):
    """
    Returns the real spherical harmonics Z_{lm}(theta, phi).
    """
    l, m, theta, phi = sympify(l), sympify(m), sympify(theta), sympify(phi)
    if m > 0:
        return sqrt((2*l+1)/(2*pi) * factorial(l-m)/factorial(l+m)) * Plm_cos(l, m, theta) * cos(m*phi)
    elif m < 0:
        m = -m
        return sqrt((2*l+1)/(2*pi) * factorial(l-m)/factorial(l+m)) * Plm_cos(l, m, theta) * sin(m*phi)
    elif m == 0:
        return sqrt((2*l+1)/(4*pi)) * Plm_cos(l, 0, theta)
    else:
        raise ValueError("Invalid m.")

def Zlm_xyz(l, m, x, y, z):
    """
    Returns the real spherical harmonics Z_{lm}(x, y, z).

    It is assumed x**2 + y**2 + z**2 == 1.
    """
    l, m, x, y, z = sympify(l), sympify(m), sympify(x), sympify(y), sympify(z)
    if m > 0:
        r = (x+I*y)**m
        r = r.as_real_imag()[0]
        return sqrt((2*l+1)/(2*pi) * factorial(l-m)/factorial(l+m)) * Plm(l, m, z) * r / sqrt(1-z**2)**m
    elif m < 0:
        m = -m
        r = (x+I*y)**m
        r = r.as_real_imag()[1]
        return sqrt((2*l+1)/(2*pi) * factorial(l-m)/factorial(l+m)) * Plm(l, m, z) * r / sqrt(1-z**2)**m
    elif m == 0:
        return sqrt((2*l+1)/(4*pi)) * Plm(l, 0, z)
    else:
        raise ValueError("Invalid m.")


var("theta phi")
x, y, z = symbols("x y z", real=True)
print "Spherical harmonics:"
print
print ".. math::"
print
for l in range(4):
    for m in range(-l, l+1):
        print r"    Y_{%d,%d}(\theta, \phi) =" % (l, m), \
            latex(Ylm(l, m, theta, phi))
        print

print
print "Real spherical harmonics:"
print
print ".. math::"
print
for l in range(4):
    for m in range(-l, l+1):
        print r"    Z_{%d,%d}(\theta, \phi) =" % (l, m), \
            latex(Zlm(l, m, theta, phi))
        print

print
print "Real spherical harmonics (using $x$, $y$ and $z$, assuming $x^2 + y^2 + z^2 = 1$):"
print
print ".. math::"
print
for l in range(4):
    for m in range(-l, l+1):
        print r"    Z_{%d,%d}(x, y, z) =" % (l, m), \
            latex(Zlm_xyz(l, m, x, y, z).simplify())
        print