17.1.21 problem 2(k)

Internal problem ID [4111]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(k)
Date solved : Saturday, October 04, 2025 at 05:22:35 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (1\right )&=1 \\ \end{align*}
Maple. Time used: 0.186 (sec). Leaf size: 21
ode:=x*y(x)*diff(y(x),x) = (1+x)*(y(x)+1); 
ic:=[y(1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\operatorname {LambertW}\left (-1, -\frac {2 \,{\mathrm e}^{-x -1}}{x}\right )-1 \]
Mathematica
ode=x*y[x]*D[y[x],x]==(x+1)*(y[x]+1); 
ic=y[1]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

{}

Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)*Derivative(y(x), x) - (x + 1)*(y(x) + 1),0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
ValueError : Couldnt solve for initial conditions