69.12.28 problem 302

Internal problem ID [18181]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 12. Miscellaneous problems. Exercises page 93
Problem number : 302
Date solved : Thursday, October 02, 2025 at 03:08:03 PM
CAS classification : [[_homogeneous, `class G`], _rational]

\begin{align*} x^{2} y^{n} y^{\prime }&=2 x y^{\prime }-y \end{align*}
Maple. Time used: 0.058 (sec). Leaf size: 32
ode:=x^2*y(x)^n*diff(y(x),x) = 2*x*diff(y(x),x)-y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y^{2 n} \left (y^{n} x -n -2\right )^{n} x^{-n}-c_1 = 0 \]
Mathematica. Time used: 0.112 (sec). Leaf size: 41
ode=x^2*y[x]^n*D[y[x],x]==2*x*D[y[x],x]-y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {n \left (\log (x)-\log \left (-x y(x)^n+n+2\right )\right )}{n+2}-\frac {2 n \log (y(x))}{n+2}=c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq(x**2*y(x)**n*Derivative(y(x), x) - 2*x*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) + y(x)/(x*(x*y(x)**n - 2)) cannot be solved