20.23.5 problem Problem 5

Internal problem ID [3977]
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.8. page 710
Problem number : Problem 5
Date solved : Sunday, March 30, 2025 at 02:13:31 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-3 y^{\prime }+2 y&=\delta \left (t -1\right ) \end{align*}

Using Laplace method With initial conditions

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

Maple. Time used: 0.136 (sec). Leaf size: 36
ode:=diff(diff(y(t),t),t)-3*diff(y(t),t)+2*y(t) = Dirac(t-1); 
ic:=y(0) = 1, D(y)(0) = 0; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = -\operatorname {Heaviside}\left (t -1\right ) {\mathrm e}^{t -1}+\operatorname {Heaviside}\left (t -1\right ) {\mathrm e}^{-2+2 t}-{\mathrm e}^{2 t}+2 \,{\mathrm e}^{t} \]
Mathematica. Time used: 0.024 (sec). Leaf size: 31
ode=D[y[t],{t,2}]-3*D[y[t],t]+2*y[t]==DiracDelta[t-1]; 
ic={y[0]==1,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^t \left (\frac {\left (e^t-e\right ) \theta (t-1)}{e^2}-e^t+2\right ) \]
Sympy. Time used: 1.037 (sec). Leaf size: 56
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Dirac(t - 1) + 2*y(t) - 3*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 1, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (\left (\int \operatorname {Dirac}{\left (t - 1 \right )} e^{- 2 t}\, dt - \int \limits ^{0} \operatorname {Dirac}{\left (t - 1 \right )} e^{- 2 t}\, dt - 1\right ) e^{t} - \int \operatorname {Dirac}{\left (t - 1 \right )} e^{- t}\, dt + \int \limits ^{0} \operatorname {Dirac}{\left (t - 1 \right )} e^{- t}\, dt + 2\right ) e^{t} \]