58.4.2 problem 2

Internal problem ID [14572]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.2 (Separable equations). Exercises page 47
Problem number : 2
Date solved : Thursday, October 02, 2025 at 09:42:26 AM
CAS classification : [_separable]

\begin{align*} y x +2 x +y+2+\left (x^{2}+2 x \right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 15
ode:=x*y(x)+2*x+y(x)+2+(x^2+2*x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -2+\frac {c_1}{\sqrt {x \left (x +2\right )}} \]
Mathematica. Time used: 0.037 (sec). Leaf size: 27
ode=(x*y[x]+2*x+y[x]+2)+(x^2+2*x)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2+\frac {c_1}{\sqrt {x} \sqrt {x+2}}\\ y(x)&\to -2 \end{align*}
Sympy. Time used: 0.196 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x) + 2*x + (x**2 + 2*x)*Derivative(y(x), x) + y(x) + 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{\sqrt {x \left (x + 2\right )}} - 2 \]