89.4.18 problem 19

Internal problem ID [24340]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Exercises at page 39
Problem number : 19
Date solved : Thursday, October 02, 2025 at 10:20:32 PM
CAS classification : [[_homogeneous, `class G`], _rational]

\begin{align*} y \left (x^{2} y^{2}-m \right )+x \left (x^{2} y^{2}+n \right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 56
ode:=y(x)*(x^2*y(x)^2-m)+x*(x^2*y(x)^2+n)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{\frac {m}{n}} {\mathrm e}^{\frac {-\operatorname {LambertW}\left (\frac {x^{\frac {2 m +2 n}{n}} {\mathrm e}^{-\frac {2 c_1 \left (m +n \right )}{n}}}{n}\right ) n -2 c_1 \left (m +n \right )}{2 n}} \]
Mathematica. Time used: 15.735 (sec). Leaf size: 84
ode=y[x]*( x^2*y[x]^2-m )+x*( x^2*y[x]^2+n)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {\sqrt {n} \sqrt {W\left (\frac {e^{\frac {2 c_1}{n}} x^{\frac {2 m}{n}+2}}{n}\right )}}{x}\\ y(x)&\to \frac {\sqrt {n} \sqrt {W\left (\frac {e^{\frac {2 c_1}{n}} x^{\frac {2 m}{n}+2}}{n}\right )}}{x} \end{align*}
Sympy. Time used: 24.760 (sec). Leaf size: 53
from sympy import * 
x = symbols("x") 
n = symbols("n") 
m = symbols("m") 
y = Function("y") 
ode = Eq(x*(n + x**2*y(x)**2)*Derivative(y(x), x) + (-m + x**2*y(x)**2)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = e^{\frac {- 2 C_{1} m - 2 C_{1} n + 2 m \log {\left (x \right )} - n W\left (\frac {x^{2} e^{\frac {2 \left (- C_{1} m - C_{1} n + m \log {\left (x \right )}\right )}{n}}}{n}\right )}{2 n}} \]