82.54.2 problem Ex. 2

Internal problem ID [18947]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter IX. Equations of the second order. problems at end of chapter at page 120
Problem number : Ex. 2
Date solved : Monday, March 31, 2025 at 06:26:17 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+\frac {2 y^{\prime }}{x}+n^{2} y&=0 \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 21
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)/x+n^2*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_1 \sin \left (n x \right )+c_2 \cos \left (n x \right )}{x} \]
Mathematica. Time used: 0.041 (sec). Leaf size: 42
ode=D[y[x],{x,2}]+2/x*D[y[x],x]+n^2*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{-i n x} \left (2 c_1-\frac {i c_2 e^{2 i n x}}{n}\right )}{2 x} \]
Sympy. Time used: 0.210 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq(n**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 )} = \frac {C_{1} J_{\frac {1}{2}}\left (n x\right ) + C_{2} Y_{\frac {1}{2}}\left (n x\right )}{\sqrt {x}} \]