5.4.6 problem 6

Internal problem ID [1500]
Book : Elementary differential equations and boundary value problems, 11th ed., Boyce, DiPrima, Meade
Section : Chapter 6.4, The Laplace Transform. Differential equations with discontinuous forcing functions. page 268
Problem number : 6
Date solved : Tuesday, September 30, 2025 at 04:34:46 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y^{\prime }+\frac {5 y}{4}&=\left \{\begin {array}{cc} \sin \left (t \right ) & 0\le t <\pi \\ 0 & \operatorname {otherwise} \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.370 (sec). Leaf size: 55
ode:=diff(diff(y(t),t),t)+diff(y(t),t)+5/4*y(t) = piecewise(0 <= t and t < Pi,sin(t),0); 
ic:=[y(0) = 0, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = -\frac {8 \left (\left \{\begin {array}{cc} {\mathrm e}^{-\frac {t}{4}} \left (-\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )+4 \cos \left (t \right ) \sinh \left (\frac {t}{4}\right )\right ) & t <\pi \\ \left (4 \cos \left (t \right )+\sin \left (t \right )\right ) \sinh \left (\frac {\pi }{4}\right ) {\mathrm e}^{-\frac {t}{2}+\frac {\pi }{4}} & \pi \le t \end {array}\right .\right )}{17} \]
Mathematica. Time used: 0.076 (sec). Leaf size: 77
ode=D[y[t],{t,2}]+D[y[t],t]+5/4*y[t]==Piecewise[{{Sin[t],0<=t<Pi},{0,True}}]; 
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 {4}{17} \left (\left (-4+4 e^{-t/2}\right ) \cos (t)+\left (1+e^{-t/2}\right ) \sin (t)\right ) & 0<t\leq \pi \\ -\frac {4}{17} e^{-t/2} \left (-1+e^{\pi /2}\right ) (4 \cos (t)+\sin (t)) & \text {True} \\ \end {array} \\ \end {array} \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((sin(t), (t >= 0) & (t < pi)), (0, True)) + 5*y(t)/4 + 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)