41.5.4 problem 4

Internal problem ID [8779]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 2. Linear homogeneous equations. Section 2.3.4 problems. page 104
Problem number : 4
Date solved : Tuesday, September 30, 2025 at 05:50:49 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{3} y^{\prime \prime }+x y^{\prime }-y&=\cos \left (\frac {1}{x}\right ) \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 26
ode:=x^3*diff(diff(y(x),x),x)+x*diff(y(x),x)-y(x) = cos(1/x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {x \left (-2 c_2 \,{\mathrm e}^{\frac {1}{x}}+\sin \left (\frac {1}{x}\right )+\cos \left (\frac {1}{x}\right )-2 c_1 \right )}{2} \]
Mathematica. Time used: 0.099 (sec). Leaf size: 66
ode=x^3*D[y[x],{x,2}]+x*D[y[x],x]-y[x]==Cos[1/x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {x \left (e^{\frac {1}{x}} \int _1^x-\frac {e^{1-\frac {1}{K[1]}} \cos \left (\frac {1}{K[1]}\right )}{K[1]^2}dK[1]-e \sin \left (\frac {1}{x}\right )+c_1 e^{\frac {1}{x}}+e^2 c_2\right )}{e} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**3*Derivative(y(x), (x, 2)) + x*Derivative(y(x), x) - y(x) - cos(1/x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-x**3*Derivative(y(x), (x, 2)) + y(x) + cos(1/x))/x cannot be solved by the factorable group method