58.5.34 problem 37 (b)

Internal problem ID [14628]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 37 (b)
Date solved : Thursday, October 02, 2025 at 09:44:44 AM
CAS classification : [_separable]

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