90.27.8 problem 8

Internal problem ID [25418]
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 : 8
Date solved : Friday, October 03, 2025 at 12:01:20 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-5 y^{\prime }+4 y&=\left \{\begin {array}{cc} 1 & 0\le t <5 \\ 0 & 5\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.073 (sec). Leaf size: 44
ode:=diff(diff(y(t),t),t)-5*diff(y(t),t)+4*y(t) = piecewise(t < 5 and 0 <= t,1,5 <= t,0); 
ic:=[y(0) = 0, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = \frac {\left (\left \{\begin {array}{cc} -4 \,{\mathrm e}^{t}+{\mathrm e}^{4 t}+3 & t \le 5 \\ {\mathrm e}^{t} \left ({\mathrm e}^{3 t}+4 \,{\mathrm e}^{-5}-{\mathrm e}^{-20+3 t}-4\right ) & 5<t \end {array}\right .\right )}{12} \]
Mathematica. Time used: 0.025 (sec). Leaf size: 69
ode=D[y[t],{t,2}]-5*D[y[t],t]+4*y[t]==Piecewise[{ {1, 0<=t<5}, {0,t>=5} }]; 
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}{12} \left (3-4 e^t+e^{4 t}\right ) & 0<t\leq 5 \\ \frac {1}{12} e^{t-20} \left (4 e^{15}-4 e^{20}-e^{3 t}+e^{3 t+20}\right ) & \text {True} \\ \end {array} \\ \end {array} \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((1, (t >= 0) & (t < 5)), (0, t >= 5)) + 4*y(t) - 5*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)