23.5.10 problem 3(i)

Internal problem ID [4187]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 7. Special functions. Exercises at page 124
Problem number : 3(i)
Date solved : Tuesday, March 04, 2025 at 05:55:09 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using series method with expansion around

\begin{align*} 0 \end{align*}

Maple. Time used: 0.013 (sec). Leaf size: 34
Order:=6; 
ode:=diff(diff(y(x),x),x)-1/x*diff(y(x),x)+(1+1/x^2)*y(x) = 0; 
dsolve(ode,y(x),type='series',x=0);
 
\[ y \left (x \right ) = x \left (\left (c_{2} \ln \left (x \right )+c_{1} \right ) \left (1-\frac {1}{4} x^{2}+\frac {1}{64} x^{4}+\operatorname {O}\left (x^{6}\right )\right )+\left (\frac {1}{4} x^{2}-\frac {3}{128} x^{4}+\operatorname {O}\left (x^{6}\right )\right ) c_{2} \right ) \]
Mathematica. Time used: 0.004 (sec). Leaf size: 66
ode=D[y[x],{x,2}]-1/x*D[y[x],x]+(1+1/x^2)*y[x] ==0; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},{y[x]},{x,0,5}]
 
\[ \{y(x)\}\to c_1 x \left (\frac {x^4}{64}-\frac {x^2}{4}+1\right )+c_2 \left (x \left (\frac {x^2}{4}-\frac {3 x^4}{128}\right )+x \left (\frac {x^4}{64}-\frac {x^2}{4}+1\right ) \log (x)\right ) \]
Sympy. Time used: 0.935 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((1 + x**(-2))*y(x) + Derivative(y(x), (x, 2)) - Derivative(y(x), x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
\[ y{\left (x \right )} = C_{1} x \left (\frac {x^{4}}{64} - \frac {x^{2}}{4} + 1\right ) + O\left (x^{6}\right ) \]