30.5.33 problem 42

Internal problem ID [7532]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.6, Substitutions and Transformations. Exercises. page 76
Problem number : 42
Date solved : Tuesday, September 30, 2025 at 04:44:47 PM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)*y+H(x)]`]]

\begin{align*} y^{\prime }&=\frac {2 y}{x}+\cos \left (\frac {y}{x^{2}}\right ) \end{align*}
Maple. Time used: 0.020 (sec). Leaf size: 67
ode:=diff(y(x),x) = 2*y(x)/x+cos(1/x^2*y(x)); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {\pi \,x^{2}}{2} \\ y &= \arctan \left (\frac {-c_1^{2} {\mathrm e}^{\frac {2}{x}}+1}{c_1^{2} {\mathrm e}^{\frac {2}{x}}+1}, \frac {2 c_1 \,{\mathrm e}^{\frac {1}{x}}}{c_1^{2} {\mathrm e}^{\frac {2}{x}}+1}\right ) x^{2} \\ \end{align*}
Mathematica. Time used: 0.507 (sec). Leaf size: 46
ode=D[y[x],x]==2*y[x]/x+Cos[ y[x]/x^2 ]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -x^2 \arcsin \left (\coth \left (\frac {1}{x}+\frac {c_1}{2}\right )\right )\\ y(x)&\to -\frac {\pi x^2}{2}\\ y(x)&\to \frac {\pi x^2}{2} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-cos(y(x)/x**2) + Derivative(y(x), x) - 2*y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -cos(y(x)/x**2) + Derivative(y(x), x) - 2*y(x)/x cannot be solve