32.2.5 problem 5

Internal problem ID [7722]
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 : 5
Date solved : Tuesday, September 30, 2025 at 05:02:09 PM
CAS classification : [_separable]

\begin{align*} x^{2} \left (y+1\right )+y^{2} \left (x -1\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 30
ode:=x^2*(1+y(x))+y(x)^2*(x-1)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \frac {x^{2}}{2}+x +\ln \left (x -1\right )+\frac {y^{2}}{2}-y+\ln \left (y+1\right )+c_1 = 0 \]
Mathematica. Time used: 0.212 (sec). Leaf size: 53
ode=x^2*(y[x]+1)+y[x]^2*(x-1)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {K[1]^2}{K[1]+1}dK[1]\&\right ]\left [\int _1^x-\frac {K[2]^2}{K[2]-1}dK[2]+c_1\right ]\\ y(x)&\to -1 \end{align*}
Sympy. Time used: 0.313 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*(y(x) + 1) + (x - 1)*y(x)**2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \frac {x^{2}}{2} + x + \frac {y^{2}{\left (x \right )}}{2} - y{\left (x \right )} + \log {\left (x - 1 \right )} + \log {\left (y{\left (x \right )} + 1 \right )} = C_{1} \]