64.20.14 problem 14

Internal problem ID [13586]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 9, The Laplace transform. Section 9.3, Exercises page 452
Problem number : 14
Date solved : Monday, March 31, 2025 at 08:01:51 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+5 y^{\prime }+6 y&=\left \{\begin {array}{cc} 6 & 0<t <2 \\ 0 & 2<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.221 (sec). Leaf size: 59
ode:=diff(diff(y(t),t),t)+5*diff(y(t),t)+6*y(t) = piecewise(0 < t and t < 2,6,2 < t,0); 
ic:=y(0) = 0, D(y)(0) = 0; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = \left \{\begin {array}{cc} 2 \,{\mathrm e}^{-3 t}-3 \,{\mathrm e}^{-2 t}+1 & t <2 \\ 2 \,{\mathrm e}^{-6}-3 \,{\mathrm e}^{-4}+2 & t =2 \\ \left (-2 \,{\mathrm e}^{6}+3 \,{\mathrm e}^{4+t}-3 \,{\mathrm e}^{t}+2\right ) {\mathrm e}^{-3 t} & 2<t \end {array}\right . \]
Mathematica. Time used: 0.042 (sec). Leaf size: 60
ode=D[y[t],{t,2}]+5*D[y[t],t]+6*y[t]==Piecewise[{{6,0<t<2},{0,t>2}}]; 
ic={y[0]==0,Derivative[1][y][0]==0}; 
DSolve[{ode,ic},{y[t]},t,IncludeSingularSolutions->True]
 
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ 1+2 e^{-3 t}-3 e^{-2 t} & 0<t\leq 2 \\ e^{-3 t} \left (2-2 e^6-3 e^t+3 e^{t+4}\right ) & \text {True} \\ \end {array} \\ \end {array} \]
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((6, (t > 0) & (t < 2)), (0, t > 2)) + 6*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)