5.2.1 Spherical coordinates

5.2.1.1 [318] In a sphere

5.2.1.1 [318] In a sphere

problem number 318

Taken from Maple pdsolve help pages

Solve for \(u( r,\theta ,\phi )\). Where \(\theta \) is the polar angle and \(\phi \) is the azimuthal angle. Hence \(0<\theta <\pi \) and \(-\pi <\phi <\pi \).

\begin {align*} \frac {\partial }{\partial r} \left (r^2 \frac {\partial u}{\partial r} \right ) + \frac {1}{\sin \theta } \frac {\partial }{\partial \theta } \left (\sin \theta \frac {\partial u}{\partial \theta } \right ) + \frac {1}{\sin ^2\theta } \frac {\partial ^2 u}{\partial \phi ^2}=0 \end {align*}

Mathematica

ClearAll["Global`*"]; 
lap = Laplacian[f[r, theta, phi], {r, theta, phi}, "Spherical"]; 
sol = AbsoluteTiming[TimeConstrained[DSolve[lap == 0, f[r, theta, phi], {r, theta, phi}], 60*10]];
 

\[\left \{\left \{f(r,\theta ,\phi )\to \begin {array}{cc} \{ & \begin {array}{cc} \sqrt {2} r^{-\frac {1}{2} \sqrt {4 c_7+1}-\frac {1}{2}} \left (c_1 r^{\sqrt {4 c_7+1}}+c_2\right ) \left (c_4 \, _2F_1\left (\frac {1}{4} \left (-\sqrt {4 c_7+1}+2 \sqrt {c_8}+1\right ),\frac {1}{4} \left (\sqrt {4 c_7+1}+2 \sqrt {c_8}+1\right );\frac {1}{2};\cos ^2(\theta )\right )+c_3 \cos (\theta ) \, _2F_1\left (\frac {1}{4} \left (-\sqrt {4 c_7+1}+2 \sqrt {c_8}+3\right ),\frac {1}{4} \left (\sqrt {4 c_7+1}+2 \sqrt {c_8}+3\right );\frac {3}{2};\cos ^2(\theta )\right ) \text {sgn}(\sin (\theta ))\right ) \left (-\sin ^2(\theta )\right )^{\frac {\sqrt {c_8}}{2}} \left (c_6 \cos \left (\phi \sqrt {c_8}\right )+c_5 \sin \left (\phi \sqrt {c_8}\right )\right ) & -\pi \leq \theta \leq \pi \land 0\leq \phi \leq \pi \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\]

Maple

restart; 
PDE := diff(r^2*diff(F(r,theta,phi),r),r)+ 1/sin(theta)*diff(sin(theta)*diff(F(r,theta,phi),theta),theta)+ 1/sin(theta)^2*diff(F(r,theta,phi),phi$2) = 0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve(PDE,F(r,theta,phi),'build')),output='realtime'));
 

\[F \left (r , \theta , \phi \right ) = \frac {\left (c_{5} \sin \left (\phi \sqrt {\textit {\_c}_{2}}\right )+c_{6} \cos \left (\phi \sqrt {\textit {\_c}_{2}}\right )\right ) \left (c_{1} r^{\frac {\sqrt {4 \textit {\_c}_{1}+1}}{2}}+c_{2} r^{-\frac {\sqrt {4 \textit {\_c}_{1}+1}}{2}}\right ) \left (c_{4} \sqrt {2}\, \hypergeom \left (\left [\frac {\sqrt {\textit {\_c}_{2}}}{2}+\frac {\sqrt {4 \textit {\_c}_{1}+1}}{4}+\frac {3}{4}, \frac {\sqrt {\textit {\_c}_{2}}}{2}-\frac {\sqrt {4 \textit {\_c}_{1}+1}}{4}+\frac {3}{4}\right ], \left [\frac {3}{2}\right ], \frac {\cos \left (2 \theta \right )}{2}+\frac {1}{2}\right ) \cos \left (\theta \right ) \mathrm {csgn}\left (\cos \left (\theta \right )\right )+c_{3} \hypergeom \left (\left [\frac {\sqrt {\textit {\_c}_{2}}}{2}+\frac {\sqrt {4 \textit {\_c}_{1}+1}}{4}+\frac {1}{4}, \frac {\sqrt {\textit {\_c}_{2}}}{2}-\frac {\sqrt {4 \textit {\_c}_{1}+1}}{4}+\frac {1}{4}\right ], \left [\frac {1}{2}\right ], \frac {\cos \left (2 \theta \right )}{2}+\frac {1}{2}\right )\right ) \left (-\left (\sin ^{2}\left (\theta \right )\right )\right )^{\frac {\sqrt {\textit {\_c}_{2}}}{2}}}{\sqrt {r}}\]

____________________________________________________________________________________