19.1.24 problem 24

Internal problem ID [4236]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 24
Date solved : Tuesday, September 30, 2025 at 07:08:06 AM
CAS classification : [_separable]

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