64.4.15 problem 15

Internal problem ID [13233]
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 : Monday, March 31, 2025 at 07:42:24 AM
CAS classification : [_separable]

\begin{align*} y+2+y \left (x +4\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,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: 8.668 (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]
 
\[ y(x)\to -2 \left (W\left (-\frac {\sqrt {x+4}}{2 \sqrt {e}}\right )+1\right ) \]
Sympy. Time used: 1.221 (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 \]