69.6.18 problem 151

Internal problem ID [18061]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 6. Linear equations of the first order. The Bernoulli equation. Exercises page 54
Problem number : 151
Date solved : Thursday, October 02, 2025 at 02:36:38 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (\infty \right )&=1 \\ \end{align*}
Maple. Time used: 0.090 (sec). Leaf size: 13
ode:=x^2*diff(y(x),x)*cos(1/x)-y(x)*sin(1/x) = -1; 
ic:=[y(infinity) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \sin \left (\frac {1}{x}\right )+\cos \left (\frac {1}{x}\right ) \]
Mathematica. Time used: 0.066 (sec). Leaf size: 14
ode=x^2*D[y[x],x]*Cos[1/x]-y[x]*Sin[1/x]==-1; 
ic={y[Infinity]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sin \left (\frac {1}{x}\right )+\cos \left (\frac {1}{x}\right ) \end{align*}
Sympy. Time used: 0.932 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*cos(1/x)*Derivative(y(x), x) - y(x)*sin(1/x) + 1,0) 
ics = {y(oo): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \tan ^{2}{\left (\frac {1}{2 x} \right )} + \tan {\left (\frac {1}{2 x} \right )} + 1 \]