26.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, March 04, 2025 at 05:59:02 PM
CAS classification : [[_homogeneous, `class D`]]

\begin{align*} x y^{\prime }&=y+2 \,{\mathrm e}^{-\frac {y}{x}} \end{align*}

Maple. Time used: 0.006 (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 (x \right ) = \left (\ln \left (2\right )+\ln \left (\frac {c_{1} x -1}{x}\right )\right ) x \]
Mathematica. Time used: 0.622 (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]
 
\[ y(x)\to x \log \left (-\frac {2}{x}+c_1\right ) \]
Sympy. Time used: 2.367 (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 )} \]