82.12.20 problem Ex. 22

Internal problem ID [18714]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter II. Equations of the first order and of the first degree. Examples on chapter II at page 29
Problem number : Ex. 22
Date solved : Monday, March 31, 2025 at 06:02:25 PM
CAS classification : [[_homogeneous, `class G`], _rational]

\begin{align*} y+\left (a \,x^{2} y^{n}-2 x \right ) y^{\prime }&=0 \end{align*}

Maple. Time used: 0.076 (sec). Leaf size: 33
ode:=y(x)+(a*x^2*y(x)^n-2*x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y^{2 n} \left (y^{n} a x -n -2\right )^{n} x^{-n}-c_1 = 0 \]
Mathematica. Time used: 0.217 (sec). Leaf size: 42
ode=y[x]+(a*x^2*y[x]^n-2*x)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {n \left (\log (x)-\log \left (-a 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") 
a = symbols("a") 
n = symbols("n") 
y = Function("y") 
ode = Eq((a*x**2*y(x)**n - 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*(a*x*y(x)**n - 2)) cannot be solved by the factorable group method