20.22.13 problem Problem 39

Internal problem ID [3968]
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 39
Date solved : Tuesday, March 04, 2025 at 05:21:41 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=3\\ y^{\prime }\left (0\right )&=-4 \end{align*}

Maple. Time used: 3.279 (sec). Leaf size: 47
ode:=diff(diff(y(t),t),t)+diff(y(t),t)-6*y(t) = 30*Heaviside(t-1)*exp(1-t); 
ic:=y(0) = 3, D(y)(0) = -4; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = \left (3 \operatorname {Heaviside}\left (-1+t \right ) {\mathrm e}^{3}+{\mathrm e}^{5 t}+2 \,{\mathrm e}^{-2+5 t} \operatorname {Heaviside}\left (-1+t \right )-5 \operatorname {Heaviside}\left (-1+t \right ) {\mathrm e}^{1+2 t}+2\right ) {\mathrm e}^{-3 t} \]
Mathematica. Time used: 0.088 (sec). Leaf size: 66
ode=D[y[t],{t,2}]+D[y[t],t]-6*y[t]==30*UnitStep[t-1]*Exp[-(t-1)]; 
ic={y[0]==3,Derivative[1][y][0] ==-4}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} e^{-3 t} \left (2+e^{5 t}\right ) & t\leq 1 \\ e^{-3 t-2} \left (2 e^2+3 e^5+2 e^{5 t}-5 e^{2 t+3}+e^{5 t+2}\right ) & \text {True} \\ \end {array} \\ \end {array} \]
Sympy. Time used: 0.789 (sec). Leaf size: 54
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-6*y(t) - 30*exp(1 - t)*Heaviside(t - 1) + Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 3, Subs(Derivative(y(t), t), t, 0): -4} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (3 e^{3} \theta \left (t - 1\right ) + 2\right ) e^{- 3 t} + \left (- 5 e^{1 - 3 t} \theta \left (t - 1\right ) + \frac {2 \theta \left (t - 1\right )}{e^{2}} + 1\right ) e^{2 t} \]