7.5.30 problem 30

Internal problem ID [134]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.6 (substitution and exact equations). Problems at page 72
Problem number : 30
Date solved : Saturday, March 29, 2025 at 04:35:10 PM
CAS classification : [[_1st_order, _with_linear_symmetries]]

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

Maple. Time used: 0.009 (sec). Leaf size: 37
ode:=(x+exp(y(x)))*diff(y(x),x) = x*exp(-y(x))-1; 
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.709 (sec). Leaf size: 52
ode=(x+Exp[y[x]])*D[y[x],x]==x*Exp[-y[x]]-1; 
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: 2.025 (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 ] \]