74.5.2 problem 2

Internal problem ID [15895]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.3, page 49
Problem number : 2
Date solved : Monday, March 31, 2025 at 02:12:12 PM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.002 (sec). Leaf size: 15
ode:=diff(y(t),t)-y(t) = 2*exp(-t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = -{\mathrm e}^{-t}+{\mathrm e}^{t} c_1 \]
Mathematica. Time used: 0.052 (sec). Leaf size: 19
ode=D[y[t],t]-y[t]==2*Exp[-t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to -e^{-t}+c_1 e^t \]
Sympy. Time used: 0.130 (sec). Leaf size: 12
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-y(t) + Derivative(y(t), t) - 2*exp(-t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = C_{1} e^{t} - e^{- t} \]