20.22.2 problem Problem 28

Internal problem ID [3957]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 10, The Laplace Transform and Some Elementary Applications. Exercises for 10.7. page 704
Problem number : Problem 28
Date solved : Tuesday, March 04, 2025 at 05:20:02 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }-2 y&=\operatorname {Heaviside}\left (t -2\right ) {\mathrm e}^{t -2} \end{align*}

Using Laplace method With initial conditions

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

Maple. Time used: 3.510 (sec). Leaf size: 32
ode:=diff(y(t),t)-2*y(t) = Heaviside(t-2)*exp(t-2); 
ic:=y(0) = 2; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = -\operatorname {Heaviside}\left (t -2\right ) {\mathrm e}^{t -2}+\operatorname {Heaviside}\left (t -2\right ) {\mathrm e}^{2 t -4}+2 \,{\mathrm e}^{2 t} \]
Mathematica. Time used: 0.097 (sec). Leaf size: 40
ode=D[y[t],t]-2*y[t]==UnitStep[t-2]*Exp[t-2]; 
ic={y[0]==2}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} 2 e^{2 t} & t\leq 2 \\ e^{t-4} \left (-e^2+e^t+2 e^{t+4}\right ) & \text {True} \\ \end {array} \\ \end {array} \]
Sympy. Time used: 0.633 (sec). Leaf size: 34
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-2*y(t) - exp(t - 2)*Heaviside(t - 2) + Derivative(y(t), t),0) 
ics = {y(0): 2} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = 2 e^{2 t} - e^{t - 2} \theta \left (t - 2\right ) + e^{2 t - 4} \theta \left (t - 2\right ) \]