68.1.5 problem Problem 1.3(c)

Internal problem ID [14063]
Book : Differential Equations, Linear, Nonlinear, Ordinary, Partial. A.C. King, J.Billingham, S.R.Otto. Cambridge Univ. Press 2003
Section : Chapter 1 VARIABLE COEFFICIENT, SECOND ORDER DIFFERENTIAL EQUATIONS. Problems page 28
Problem number : Problem 1.3(c)
Date solved : Monday, March 31, 2025 at 12:02:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.033 (sec). Leaf size: 62
ode:=diff(diff(y(x),x),x)+diff(y(x),x)/x+(1-1/4/x^2)*y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_2 \sin \left (x \right )+c_1 \cos \left (x \right )-\frac {3 \sqrt {2}\, \sqrt {\pi }\, \operatorname {FresnelC}\left (\frac {\sqrt {2}\, \sqrt {x}}{\sqrt {\pi }}\right ) \sin \left (x \right )}{4}+\frac {3 \sqrt {2}\, \sqrt {\pi }\, \operatorname {FresnelS}\left (\frac {\sqrt {2}\, \sqrt {x}}{\sqrt {\pi }}\right ) \cos \left (x \right )}{4}+x^{{3}/{2}}}{\sqrt {x}} \]
Mathematica. Time used: 0.32 (sec). Leaf size: 111
ode=D[y[x],{x,2}]+1/x*D[y[x],x]+(1-1/(4*x^2))*y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{-i x} \left (-\frac {e^{2 i x} x^{3/2} \Gamma \left (\frac {5}{2},i x\right )}{\sqrt {-i x}}+\sqrt {x^2} \left (2 c_1-i c_2 e^{2 i x}\right )+\frac {(i x)^{3/2} \Gamma \left (\frac {5}{2},-i x\right )}{\sqrt {x}}\right )}{2 \sqrt {x} \sqrt {x^2}} \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + (1 - 1/(4*x**2))*y(x) + Derivative(y(x), (x, 2)) + Derivative(y(x), x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (4*x**2*(x - y(x) - Derivative(y(x), (x, 2))) + y(x))/(4*x) cannot be solved by the factorable group method