90.27.12 problem 12

Internal problem ID [25422]
Book : Ordinary Differential Equations. By William Adkins and Mark G Davidson. Springer. NY. 2010. ISBN 978-1-4614-3617-1
Section : Chapter 6. Discontinuous Functions and the Laplace Transform. Exercises at page 425
Problem number : 12
Date solved : Friday, October 03, 2025 at 12:01:23 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 y^{\prime }+y&=\left \{\begin {array}{cc} {\mathrm e}^{-t} & 0\le t <4 \\ 0 & 4\le t \end {array}\right . \end{align*}

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=0 \\ y^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.119 (sec). Leaf size: 26
ode:=diff(diff(y(t),t),t)+2*diff(y(t),t)+y(t) = piecewise(t < 4 and 0 <= t,exp(-t),4 <= t,0); 
ic:=[y(0) = 0, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = {\mathrm e}^{-t} \left (\left \{\begin {array}{cc} \frac {t^{2}}{2} & t <4 \\ 4 t -8 & 4\le t \end {array}\right .\right ) \]
Mathematica. Time used: 0.028 (sec). Leaf size: 41
ode=D[y[t],{t,2}]+2*D[y[t],t]+y[t]==Piecewise[{ {Exp[-t], 0<=t<4},  {0,t>=4} }]; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ \frac {1}{2} e^{-t} t^2 & 0<t\leq 4 \\ 4 e^{-t} (t-2) & \text {True} \\ \end {array} \\ \end {array} \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((exp(-t), (t >= 0) & (t < 4)), (0, t >= 4)) + y(t) + 2*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 0, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)