Laplacian Eigenstuff: Sphere: Dirichlet

Lets see that we did the computation correct on the board.

Simplify[
(((r^2)Laplacian[ R[r]Φ[ϕ]Θ[θ],{r,θ,ϕ},"Spherical"])/(R[r]Φ[ϕ]Θ[θ]))== -λ (r^2)
]

Φ equation

So the only part with ϕ in it is the last term and we can isolate the first equation 
	Φ''[ϕ]+((μ1)^2) Φ[ϕ]==0
just like we did on the board. “Move the last term to one side and divide by Csc[θ] and call the resulting constant -((μ1)^2).”  Just like on the board and just like almost all the earlier examples the periodic boundary conditions (Φ[0]=Φ[2π] and  Φ'[0]=Φ'[2π]) gives μ1=n and 
	Φ[ϕ]=(Subscript[C, 1])Cos[n ϕ]+(Subscript[C, 2])Sin[n ϕ].
For n=0 we get a single constant function out of this while for n=1,2,3,4,… we get two linearly independent solutions. Replacing  Φ''[ϕ]/Φ[ϕ]=-(n^2) gives
	(r^2) λ+((r (2 R'[r]+r R''[r]))/(R[r]))+((Cot[θ] Θ'[θ]+Θ''[θ])/(Θ[θ]))-((Csc[θ])^2) (n^2)==0

R and Θ equations

Our equation is now
	(r^2) λ+((r (2 R'[r]+r R''[r]))/(R[r]))+((Cot[θ] Θ'[θ]+Θ''[θ])/(Θ[θ]))-((Csc[θ])^2) (n^2)==0
Leaving the last two terms where they are and moving the other two terms to the other side gives 
	-((r^2) λ+((r (2 R'[r]+r R''[r]))/(R[r])))==((Cot[θ] Θ'[θ]+Θ''[θ])/(Θ[θ]))-((Csc[θ])^2) (n^2)
As always, for the two terms to be equal they must equal a constant.  Lets call the constant -((μ2)^2).  The equations we get are 
	-((r^2) λ+((r (2 R'[r]+r R''[r]))/(R[r])))== -((μ2)^2)
and 
	((Cot[θ] Θ'[θ]+Θ''[θ])/(Θ[θ]))-((Csc[θ])^2) (n^2)==-((μ2)^2)
The θ equation only has one unknown constant in it (remember we know all the values of n) so we are going to do it first.

Θ equation

The θ equation is 
	((Cot[θ] Θ'[θ]+Θ''[θ])/(Θ[θ]))-((Csc[θ])^2) (n^2)==-((μ2)^2)
The solution is yet another pair of special functions.  These are Legendre (an old French guy this time) functions this time

Clear[Θ,θ]
DSolve[
((Cot[θ] Θ'[θ]+Θ''[θ])/(Θ[θ]))-((Csc[θ])^2) (n^2)==-((μ2)^2),
Θ[θ],
θ]

TraditionalForm[Sin[x^(1/2)]]

Legendre ODE

Apparently we can make the equation look cleaner by substituting 
	u=Cos[θ] 
in which case
	 (du/(dθ))=-Sin[θ]=-(Sqrt[1-(u^2)])
and
	(((d^2)u)/((dθ)^2))=-Cos[θ]=-u
or equivalently (and more usefully)
	({{θ, ->, ArcCos[u],  ,  }, {((dΘ)/(dθ)), ->, ((dΘ)/du)(du/(dθ)), =, -(Sqrt[1-(u^2)])((dΘ)/du)}, {(((d^2)Θ)/((dθ)^2)), ->, (((d^2)Θ)/(du^2))((((du/(dθ))))^2)+((dΘ)/du)(((d^2)u)/((dθ)^2)), =, (((d^2)Θ)/(du^2))(1-(u^2))-u((dΘ)/du)}})
Getting the computer to do this is not too bad

((Cot[θ] Θ'[θ]+Θ''[θ])/(Θ[θ]))-((Csc[θ])^2) (n^2)+((μ2)^2)==0/.{
Θ[θ]->Θ[u],
Θ'[θ]->-(Sqrt[1-(u^2)])Θ'[u],
Θ''[θ]->Θ''[u](1-(u^2))- u Θ'[u],
θ->ArcCos[u]
}

All we really need to do now is clean out the fractions 
As always we can get the computer to do stuff for us.

Simplify[
Θ[u](1-(u^2))(-((n^2)/(1-(u^2)))+((μ2)^2)+((-2 u Θ'[u]+(1-(u^2)) Θ''[u])/(Θ[u])))==0
]

This all matches.

Clear[n]
DSolve[
((n^2)+(-1+(u^2)) ((μ2)^2)) Θ[u]==(-1+(u^2)) (2 u Θ'[u]+(-1+(u^2)) Θ''[u]),
Θ[u],
u]

Mma says the Legendre Polynomials (Subscript[P, n]) and (Subscript[Q, n]) satisfy the ODE 
	(1-(x^2))((d^2)y/d(x^2))-2x(dy/dx)+n(n+1)y=0.

The (Subscript[P, n]) are the parts of the solution that are potentially nice at x=±1.

(Subscript[P, n])=(1/((2^n)n!))((d^n)/(dx^n))[(1/2)((((x^2)-1))^n)]

The (Subscript[Q, n]) are not nice at the end points.

The associated Legendre Polynomials (Subscript[P, n]^m) and (Subscript[Q, n]^m) are defined by
	(Subscript[P, n]^m)(x)=(((-1))^m)(((1-(x^2)))^(m/2))((d^m)/d(x^m))(Subscript[P, n])(x)

Since we are plugging Cos[θ] in for x we are only interested in -1≤x≤1.

We need to know what these functions look like.  We also need to work out what behavior we need for our solutions to make physical sense at θ=0 and θ=π.

For integers the Ps are polynomials, the Qs are not.

θ Boundary Conditions

Our sphere is described by 0≤r≤(Subscript[r, max]) and 0≤ϕ≤2π and 0≤θ≤π.

θ=0 is the north pole and θ=π is the south pole. Our question is. What does a function of θ times a function of Sin[n ϕ]  have to look like to be smooth at the North Pole? This is going to give us our boundary behavior for our North-South angle variable θ.

SphericalPlot3D[ 1 + 0.1 ((Sin[θ])^2)Cos[3 ϕ],{θ,0, π/2},{ϕ,0,2π}]

So “What Boundary Conditions do I need at θ=0?” I need Θ[0]=0. Of course, the same argument holds at the South Pole.

Spherical Harmonics

Turns out it is simpler than you would fear when you look at it (largely because of the conventions folks picked when defining these functions in the dim and distant past).  Here are some pics of the angular parts of the eigen functions that you get as a Spherical plot superimposed on a sphere.

Clear[m,n,θ,ϕ]
{m,n}={5,3}
ϵ=0.01;
SphericalPlot3D[  1+ϵ Cos[n ϕ] LegendreP[m,n,Cos[θ]],
{θ,0, π},{ϕ,0,2π},
PlotLabel->{m,n}]
ContourPlot[ 
Cos[n ϕ] LegendreP[m,n,Cos[θ]],
{ϕ,0,2π},{θ,0, π},
PlotLabel->{m,n}]

Since the combination of functions is relatively common and usefull it is called a SphericalHarmonic and is available on most if not all modern computer systems.

{m,n}={5,3};
SphericalHarmonicY[m,n,θ,ϕ]

They are normalized (the ugly number) and have the Sine and Cosine of ϕ lumped together in the complex exponential.

ContourPlot[ 
Re[
SphericalHarmonicY[m,n,θ,ϕ]
],
{ϕ,0, 2π},{θ,0, π},
PlotLabel->{m,n}]

Here is a table of the first few

TableForm[
Table[
SphericalHarmonicY[m,n,θ,ϕ],
{m, 1,4},
{n,1,3}],
TableHeadings->Automatic
]

Value for μ2

Last thing we need is the values for the separation constant μ2.  Since the soluions we need happen when the first argument of the Legendre functions are an integer we have been calling m we can just plug in and solve for ((μ2)^2) by hand.  Or if we are lazy

Clear[m,n]
((μ2)^2)/.Solve[ (1/2) (-1+(Sqrt[1+4 ((μ2)^2)]))==m, μ2]

So ((μ2)^2)=m(1+m).

R equation

The R equation is now
	-((r^2) λ+((r (2 R'[r]+r R''[r]))/(R[r])))== -m(1+m)
The solution is yet another flavor of Bessel functions.

Clear[r,R,μ2,m]
DSolve[
-((r^2) λ+ ((r (2 R'[r]+r R''[r]))/(R[r])))+ m (m+1)==0,
R[r],
r]

As always one set is bounded and nice (the Js) and the other is unbounded at the origin (the Ys).  If we have a solid sphere then the behavior is nice at the middle and we do not need the Ys.  As before the last set of constants (λ) is determined by the zeros of these SphericalBessel functions.  Everything looks pretty clean here only because this is exactly what these functions were defined to do!

Clear[m]
Plot[ 
{
SphericalBesselJ[0,z],
SphericalBesselJ[1,z],
SphericalBesselJ[2,z]
},
{z,0, 23},
PlotLegends->All,
PlotRange->All]