38.2.5 problem 5

Internal problem ID [6434]
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 : Wednesday, March 05, 2025 at 12:41:44 AM
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.005 (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.463 (sec). Leaf size: 56
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 [\frac {1}{2} (\text {$\#$1}+1)^2-2 (\text {$\#$1}+1)+\log (\text {$\#$1}+1)\&\right ]\left [-\frac {x^2}{2}-x-\log (x-1)+\frac {3}{2}+c_1\right ] \\ y(x)\to -1 \\ \end{align*}
Sympy. Time used: 0.498 (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} \]