23.1.12 problem 2(b)

Internal problem ID [4102]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(b)
Date solved : Sunday, March 30, 2025 at 02:18:00 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=0 \end{align*}

Maple. Time used: 0.088 (sec). Leaf size: 13
ode:=diff(y(x),x) = exp(x-2*y(x)); 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\ln \left (2 \,{\mathrm e}^{x}-1\right )}{2} \]
Mathematica. Time used: 0.826 (sec). Leaf size: 17
ode=D[y[x],x]==Exp[x-2*y[x]]; 
ic=y[0]==0; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \log \left (2 e^x-1\right ) \]
Sympy. Time used: 0.375 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-exp(x - 2*y(x)) + Derivative(y(x), x),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\log {\left (2 e^{x} - 1 \right )}}{2} \]