8.5.30 problem 30

Internal problem ID [758]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.6, Substitution methods and exact equations. Page 74
Problem number : 30
Date solved : Saturday, March 29, 2025 at 10:20:03 PM
CAS classification : [[_1st_order, _with_linear_symmetries]]

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

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