65.5.2 problem 10.1 (ii)

Internal problem ID [13670]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 10, Two tricks for nonlinear equations. Exercises page 97
Problem number : 10.1 (ii)
Date solved : Monday, March 31, 2025 at 08:07:24 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 18
ode:=1+y(x)*exp(x)+x*exp(x)*y(x)+(x*exp(x)+2)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-x +c_1}{x \,{\mathrm e}^{x}+2} \]
Mathematica. Time used: 0.139 (sec). Leaf size: 21
ode=(1+Exp[x]*y[x]+x*Exp[x]*y[x])+(x*Exp[x]+2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {-x+c_1}{e^x x+2} \]
Sympy. Time used: 0.374 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)*exp(x) + (x*exp(x) + 2)*Derivative(y(x), x) + y(x)*exp(x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} - x}{x e^{x} + 2} \]