38.2.17 problem 17

Internal problem ID [6446]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Further problems 24. page 1068
Problem number : 17
Date solved : Wednesday, March 05, 2025 at 12:45:06 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`], [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.003 (sec). Leaf size: 53
ode:=x-x*y(x)^2 = (x+x^2*y(x))*diff(y(x),x); 
dsolve(ode,y(x), singsol=all);
 
\[ x +\frac {\sqrt {y^{2}-1}\, \ln \left (y+\sqrt {y^{2}-1}\right )}{\left (y-1\right ) \left (y+1\right )}-\frac {c_1}{\sqrt {y-1}\, \sqrt {y+1}} = 0 \]
Mathematica. Time used: 0.13 (sec). Leaf size: 37
ode=(x-x*y[x]^2)==(x+x^2*y[x])*D[y[x],x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=\frac {\arcsin (y(x))}{\sqrt {1-y(x)^2}}+\frac {c_1}{\sqrt {1-y(x)^2}},y(x)\right ] \]
Sympy. Time used: 1.130 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*y(x)**2 + x - (x**2*y(x) + x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + x \sqrt {y^{2}{\left (x \right )} - 1} + \log {\left (\sqrt {y^{2}{\left (x \right )} - 1} + y{\left (x \right )} \right )} = 0 \]