Physics 4392: Professor Olness  Fall 2001

Exercise #1:

Turn of some anoying features

Off[General::"spell1"] ; Off[
        General::"spell"] ;

Load the needed packages:

<<Graphics`PlotField`

<<Graphics`PlotField3D`

<<Calculus`VectorAnalysis`

Separation of Variables: Cartesian

Clear["Global`*"]

SetCoordinates[Cartesian[x, y, z]];

ψ[x_, y_, z_] = X[x] Y[y] Z[z]

Laplacian[ ψ[x, y, z] ]

eq1 =  ((Laplacian[ ψ[x, y, z] ] )/ψ)[x, y, z]  // Expand

?Select

select[eq_, var_] := Select[eq, ! FreeQ[#, var] &]

xEq =  select[eq1, x]

DSolve[xEq == -(cx^2), X[x], x]  // Flatten

DSolve[xEq == +(cx^2), X[x], x]  // Flatten

{Cos[cx x], 
        Sin[cx x] }//TrigToExp

yEq =  select[eq1, y]

zEq =  select[eq1, z]

Separation of Variables: Spherical
Warning: Mathematica 3.0 (the lab version) cannot solve all these steps

Clear["Global`*"]

SetCoordinates[Spherical[r, θ, ϕ]];

ψ[r_, θ_, ϕ_] = 
      R[r] Θ[θ] Φ[ϕ]

Laplacian[ ψ[r, θ, ϕ] ]

eq1 =  (r^2) ((Laplacian[ ψ[r, θ, ϕ] ] )/ψ)[r, θ, ϕ]  // Expand

select[eq_, var_] := Select[eq, ! FreeQ[#, var] &]

rEq =  select[eq1, r]  - ℓ (ℓ + 1)

DSolve[rEq == 0, R[r], r]   // Flatten

eq2 =  eq1  -  rEq

eq3 =  (eq2/Csc)[θ]^2  // Expand

ϕEq = select[eq3, ϕ] +  (m^2)

DSolve[ϕEq == 0, Φ[ϕ], ϕ]  // 
      Flatten

eq4  =  eq3  -  ϕEq

Mathematica cannot solve this directly; however, if we change variables, Mathematica will recognize this as the Lengendre equation.  To implement the change of variable z=Cos[θ], we generate the following rule which will implement this in general.

dRule={Derivative[n_Integer][Θ][θ]:>Nest[(∂_z) #(1/(∂_z)) ArcCos[z] &, Z[z], n],Θ[θ] :> Z[z],θ :> ArcCos[z]};

As a cross check, we examine how it transforms Θ[θ] and its derivatives.

{Θ[θ], Θ'[θ], Θ''[θ]}  /. dRule  // Simplify

θEq =  eq4  //. dRule // Simplify

DSolve[θEq == 0, Z[z], z]  // Flatten

Separation of Variables: Cyllindrical
You do this for homework: Due Tuesday Oct 2
Hints: 
1) For the Z-equation, use  separation constant: -cz^2
2) For the ϕ-equation, use  separation constant: +m^2

Clear["Global`*"]

SetCoordinates[Cylindrical[r, ϕ, z]];

ψ[r_, ϕ_, z_] = R[r]  Φ[ϕ] Z[z]

Laplacian[ ψ[r, ϕ, z] ]  // Simplify

eq1 =   ((Laplacian[ ψ[r, ϕ, z] ] )/ψ)[r, ϕ, z]  // Expand

select[eq_, var_] := Select[eq, ! FreeQ[#, var] &]