23.3.137 problem 139

Internal problem ID [5851]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 139
Date solved : Friday, October 03, 2025 at 01:44:08 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} \left (p \left (1+p \right )-k^{2} \csc \left (x \right )^{2}\right ) y+\cot \left (x \right ) y^{\prime }+y^{\prime \prime }&=0 \end{align*}
Maple. Time used: 0.060 (sec). Leaf size: 19
ode:=(p*(1+p)-k^2*csc(x)^2)*y(x)+cot(x)*diff(y(x),x)+diff(diff(y(x),x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_1 \operatorname {LegendreP}\left (p , k , \cos \left (x \right )\right )+c_2 \operatorname {LegendreQ}\left (p , k , \cos \left (x \right )\right ) \]
Mathematica. Time used: 0.29 (sec). Leaf size: 22
ode=(p*(1 + p) - k^2*Csc[x]^2)*y[x] + Cot[x]*D[y[x],x] + D[y[x],{x,2}] == 0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to c_1 P_p^k(\cos (x))+c_2 Q_p^k(\cos (x)) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
k = symbols("k") 
p = symbols("p") 
y = Function("y") 
ode = Eq((-k**2/sin(x)**2 + p*(p + 1))*y(x) + Derivative(y(x), (x, 2)) + Derivative(y(x), x)/tan(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -(k**2*y(x) - (p**2*y(x) + p*y(x) + Derivative(y(x), (x, 2)))*si