83.41.4 problem 2 (iii)

Internal problem ID [19413]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter VIII. Linear equations of second order. Excercise at end of chapter VIII. Page 141
Problem number : 2 (iii)
Date solved : Monday, March 31, 2025 at 07:12:59 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-\frac {2 y^{\prime }}{x}+\left (n^{2}+\frac {2}{x^{2}}\right ) y&=0 \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 19
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)/x+(n^2+2/x^2)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \left (c_1 \sin \left (n x \right )+c_2 \cos \left (n x \right )\right ) \]
Mathematica. Time used: 0.032 (sec). Leaf size: 38
ode=D[y[x],{x,2}]-2/x*D[y[x],x]+(n^2+2/x^2)*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_1 x e^{-i n x}-\frac {i c_2 x e^{i n x}}{2 n} \]
Sympy. Time used: 0.236 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq((n**2 + 2/x**2)*y(x) + Derivative(y(x), (x, 2)) - 2*Derivative(y(x), x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x^{\frac {3}{2}} \left (C_{1} J_{\frac {1}{2}}\left (n x\right ) + C_{2} Y_{\frac {1}{2}}\left (n x\right )\right ) \]