20.1.5 problem 1.

Internal problem ID [4245]
Book : Differential equations with applications and historial notes, George F. Simmons. Second edition. 1971
Section : Chapter 2, section 7, page 37
Problem number : 1.
Date solved : Tuesday, September 30, 2025 at 07:08:37 AM
CAS classification : [[_homogeneous, `class D`]]

\begin{align*} x y^{\prime }&=y+2 \,{\mathrm e}^{-\frac {y}{x}} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 19
ode:=x*diff(y(x),x) = y(x)+2*exp(-y(x)/x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\ln \left (2\right )+\ln \left (\frac {c_1 x -1}{x}\right )\right ) x \]
Mathematica. Time used: 0.381 (sec). Leaf size: 16
ode=x*D[y[x],x]==y[x]+2*Exp[- y[x]/x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x \log \left (-\frac {2}{x}+c_1\right ) \end{align*}
Sympy. Time used: 1.600 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - y(x) - 2*exp(-y(x)/x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \log {\left (C_{1} - \frac {2}{x} \right )} \]