15.3.18 problem 18

Internal problem ID [2911]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 7, page 28
Problem number : 18
Date solved : Sunday, March 30, 2025 at 12:53:22 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (-4\right )&=2 \end{align*}

Maple. Time used: 0.154 (sec). Leaf size: 20
ode:=x-2*y(x)+3+(1-x+2*y(x))*diff(y(x),x) = 0; 
ic:=y(-4) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {7}{2}+\frac {x}{2}+4 \operatorname {LambertW}\left (\frac {{\mathrm e}^{\frac {5}{8}+\frac {x}{8}}}{8}\right ) \]
Mathematica. Time used: 4.659 (sec). Leaf size: 28
ode=(x-2*y[x]+3)+(1-x+2*y[x])*D[y[x],x]==0; 
ic={y[-4]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \left (8 W\left (\frac {1}{8} e^{\frac {x+5}{8}}\right )+x+7\right ) \]
Sympy. Time used: 15.284 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (-x + 2*y(x) + 1)*Derivative(y(x), x) - 2*y(x) + 3,0) 
ics = {y(-4): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{2} + 4 W\left (\frac {e^{\frac {5}{8}} \sqrt [8]{e^{x}}}{8}\right ) + \frac {7}{2} \]