14.19.4 problem 7

Internal problem ID [2697]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.12, Dirac delta function. Excercises page 250
Problem number : 7
Date solved : Sunday, March 30, 2025 at 12:15:05 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

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

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