I am trying to solve the spherical harmonics PDE in Mathemtica. My code is:

pde =  1/Sin[\[Theta]]^2 D[f[\[Theta], \[Phi]], {\[Phi], 2}] + 
Cot[\[Theta]] D[f[\[Theta], \[Phi]], \[Theta]]  + 
D[f[\[Theta], \[Phi]], {\[Theta], 2}] + c f[\[Theta], \[Phi]] == 0

DSolve[ pde, f[\[Theta], \[Phi]], {\[Theta], \[Phi]}]

DSolve seems to be unable to solve this PDE. Am I making a mistake here somewhere?

  • 1
    $\begingroup$ Mathematica currently does not solve the laplace on spherical coordinates even just the angular part. see how-to-obtain-general-solution-for-laplace-pde-in-spherical-coordinates-using-ds btw, it help if you post a link to the PDE you are trying to solve as you have extra term there c*f which I do not know where it came from. different from SphericalHarmonicDifferentialEquation $\endgroup$
    – Nasser
    Commented Jan 12, 2019 at 11:25
  • $\begingroup$ The extra c*f term comes about because I'm trying to solve the eigenvalue equation. See this, where the eigenvalue is denoted by lambda. $\endgroup$
    – cord
    Commented Jan 12, 2019 at 11:56
  • 2
    $\begingroup$ I have no idea which PDE you are trying to solve. That is why it is best to write the math in the question. You are adding c*f, where f is the dependent variable. This looks like Helmholtz_equation with the angular part of the Laplace PDE only in spherical coordinates? Any way, Mathematica can't solve these PDE's analytically at this time. May be in version 12 it can. $\endgroup$
    – Nasser
    Commented Jan 12, 2019 at 12:01

1 Answer 1

pde = D[f[θ, ϕ], {ϕ, 2}]/Sin[θ]^2 + Cot[θ]*D[f[θ, ϕ], θ] + D[f[θ, ϕ], {θ, 2}] + 
    λ*f[θ, ϕ] == 0

You know it is periodic in ϕ so use that by assuming a solution.

f[θ_, ϕ_] = Q[θ] Cos[m ϕ]

θeq = pde/f[θ, ϕ] // Expand
(*λ - m^2*Csc[θ]^2 + Derivative[2][Q][θ]/Q[θ] + (Cot[θ]*Derivative[1][Q][θ])/Q[θ] == 0*)

DSolve[θeq, Q[θ], θ]

f[θ, ϕ] = f[θ, ϕ] /. %[[1]]
(*Cos[m*ϕ]*(C[1]*LegendreP[(1/2)*(Sqrt[4*λ + 1] - 1), m, Cos[θ]] + 
   C[2]*LegendreQ[(1/2)*(Sqrt[4*λ + 1] - 1), m, Cos[θ]])*)

I'll let you solve for the constants, since you know what your ultimate goals and objectives for this solution are.

Mathematica is still fairly new to solving pde's so don't expect it to solve all of them without some extra work.

Note if you prefer to use E^(I m ϕ) instead of Cos[m ϕ] for ϕ dependence,θeq will be the same.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.