75.6.18 problem 151

Internal problem ID [16695]
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, March 13, 2025 at 08:32:06 AM
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.269 (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,ic],y(x), singsol=all);
 
\[ y = \sin \left (\frac {1}{x}\right )+\cos \left (\frac {1}{x}\right ) \]
Mathematica. Time used: 0.097 (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]
 
\[ y(x)\to \sin \left (\frac {1}{x}\right )+\cos \left (\frac {1}{x}\right ) \]
Sympy. Time used: 1.340 (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 \]