23.3.135 problem 137

Internal problem ID [5849]
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 : 137
Date solved : Friday, October 03, 2025 at 01:44:07 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} k \left (1+k \right ) y+\cot \left (x \right ) y^{\prime }+y^{\prime \prime }&=0 \end{align*}
Maple. Time used: 0.091 (sec). Leaf size: 45
ode:=k*(1+k)*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 {hypergeom}\left (\left [-\frac {k}{2}, \frac {1}{2}+\frac {k}{2}\right ], \left [\frac {1}{2}\right ], \cos \left (x \right )^{2}\right )+c_2 \cos \left (x \right ) \operatorname {hypergeom}\left (\left [1+\frac {k}{2}, \frac {1}{2}-\frac {k}{2}\right ], \left [\frac {3}{2}\right ], \cos \left (x \right )^{2}\right ) \]
Mathematica. Time used: 0.085 (sec). Leaf size: 20
ode=k*(1 + k)*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 \operatorname {LegendreP}(k,\cos (x))+c_2 \operatorname {LegendreQ}(k,\cos (x)) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
k = symbols("k") 
y = Function("y") 
ode = Eq(k*(k + 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) - k*y(x) - Derivative(y(x), (x, 2)))*tan(x) + Deriv