81.1.11 problem 2-9

Internal problem ID [21456]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 2. Separable differential equations
Problem number : 2-9
Date solved : Thursday, October 02, 2025 at 07:38:30 PM
CAS classification : [_separable]

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

With initial conditions

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