38.2.20 problem 20

Internal problem ID [6449]
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 : 20
Date solved : Wednesday, March 05, 2025 at 12:45:51 AM
CAS classification : [[_homogeneous, `class G`], _rational]

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

Maple. Time used: 0.023 (sec). Leaf size: 38
ode:=y(x)*(1+x*y(x))+x*(1+x*y(x)+x^2*y(x)^2)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{\operatorname {RootOf}\left (-2 \ln \left (x \right ) {\mathrm e}^{2 \textit {\_Z}}+2 c_1 \,{\mathrm e}^{2 \textit {\_Z}}+2 \textit {\_Z} \,{\mathrm e}^{2 \textit {\_Z}}-2 \,{\mathrm e}^{\textit {\_Z}}-1\right )}}{x} \]
Mathematica. Time used: 0.126 (sec). Leaf size: 28
ode=y[x]*(x*y[x]+1)+x*(1+x*y[x]+x^2*y[x]^2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\log (y(x))-\frac {2 x y(x)+1}{2 x^2 y(x)^2}=c_1,y(x)\right ] \]
Sympy. Time used: 1.242 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(x**2*y(x)**2 + x*y(x) + 1)*Derivative(y(x), x) + (x*y(x) + 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \log {\left (x \right )} + \log {\left (x y{\left (x \right )} \right )} + \frac {- 2 x y{\left (x \right )} - 1}{2 x^{2} y^{2}{\left (x \right )}} = C_{1} \]