58.4.15 problem 15

Internal problem ID [14585]
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 : 15
Date solved : Thursday, October 02, 2025 at 09:43:08 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (-3\right )&=-1 \\ \end{align*}
Maple. Time used: 0.230 (sec). Leaf size: 18
ode:=y(x)+2+y(x)*(x+4)*diff(y(x),x) = 0; 
ic:=[y(-3) = -1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -2 \operatorname {LambertW}\left (-\frac {\sqrt {x +4}\, {\mathrm e}^{-\frac {1}{2}}}{2}\right )-2 \]
Mathematica. Time used: 3.09 (sec). Leaf size: 26
ode=(y[x]+2)+(y[x]*(x+4))*D[y[x],x]==0; 
ic={y[-3]==-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2 \left (W\left (-\frac {\sqrt {x+4}}{2 \sqrt {e}}\right )+1\right ) \end{align*}
Sympy. Time used: 0.793 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x + 4)*y(x)*Derivative(y(x), x) + y(x) + 2,0) 
ics = {y(-3): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - 2 W\left (- \frac {\sqrt {x + 4}}{2 e^{\frac {1}{2}}}\right ) - 2 \]