10.4.4 problem 5

Internal problem ID [1185]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.5. Page 88
Problem number : 5
Date solved : Saturday, March 29, 2025 at 10:45:05 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=-1+{\mathrm e}^{-y} \end{align*}

Maple. Time used: 0.012 (sec). Leaf size: 18
ode:=diff(y(t),t) = -1+exp(-y(t)); 
dsolve(ode,y(t), singsol=all);
 
\[ y = -t +\ln \left (-1+{\mathrm e}^{t +c_1}\right )-c_1 \]
Mathematica. Time used: 0.797 (sec). Leaf size: 21
ode=D[y[t],t] == -1+Exp[-y[t]]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)\to \log \left (1+e^{-t+c_1}\right ) \\ y(t)\to 0 \\ \end{align*}
Sympy. Time used: 0.223 (sec). Leaf size: 10
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(Derivative(y(t), t) + 1 - exp(-y(t)),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \log {\left (C_{1} e^{- t} + 1 \right )} \]