65.5.2 problem 10.1 (ii)

Internal problem ID [13662]
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 : Wednesday, March 05, 2025 at 10:10:25 PM
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+exp(x)*y(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}}{{\mathrm e}^{x} 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} \]