15.7.18 problem 18

Internal problem ID [2999]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 11, page 45
Problem number : 18
Date solved : Tuesday, March 04, 2025 at 03:39:42 PM
CAS classification : [[_1st_order, _with_linear_symmetries], _Bernoulli]

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

With initial conditions

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

Maple. Time used: 0.032 (sec). Leaf size: 8
ode:=diff(y(t),t)+y(t) = y(t)^2*exp(-t); 
ic:=y(0) = 2; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = 2 \,{\mathrm e}^{t} \]
Mathematica. Time used: 0.329 (sec). Leaf size: 10
ode=D[y[t],t]+y[t]==y[t]^2*Exp[-t]; 
ic={y[0]==2}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to 2 e^t \]
Sympy. Time used: 0.221 (sec). Leaf size: 7
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-y(t)**2*exp(-t) + y(t) + Derivative(y(t), t),0) 
ics = {y(0): 2} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = 2 e^{t} \]