7.21.7 problem 7

Internal problem ID [570]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 4. Laplace transform methods. Section 4.6 (Impulses and Delta functions). Problems at page 324
Problem number : 7
Date solved : Saturday, March 29, 2025 at 04:56:55 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+4 x^{\prime }+5 x&=\delta \left (t -\pi \right )+\delta \left (t -2 \pi \right ) \end{align*}

Using Laplace method With initial conditions

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

Maple. Time used: 0.300 (sec). Leaf size: 36
ode:=diff(diff(x(t),t),t)+4*diff(x(t),t)+5*x(t) = Dirac(t-Pi)+Dirac(t-2*Pi); 
ic:=x(0) = 0, D(x)(0) = 2; 
dsolve([ode,ic],x(t),method='laplace');
 
\[ x = \sin \left (t \right ) {\mathrm e}^{-2 t} \left (-\operatorname {Heaviside}\left (t -\pi \right ) {\mathrm e}^{2 \pi }+\operatorname {Heaviside}\left (t -2 \pi \right ) {\mathrm e}^{4 \pi }+2\right ) \]
Mathematica. Time used: 0.066 (sec). Leaf size: 40
ode=D[x[t],{t,2}]+4*D[x[t],t]+5*x[t]==DiracDelta[t-Pi]+DiracDelta[t-2*Pi]; 
ic={x[0]==0,Derivative[1][x][0] ==2}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to e^{-2 t} \left (e^{4 \pi } \theta (t-2 \pi )-e^{2 \pi } \theta (t-\pi )+2\right ) \sin (t) \]
Sympy. Time used: 9.175 (sec). Leaf size: 124
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-Dirac(t - 2*pi) - Dirac(t - pi) + 5*x(t) + 4*Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 2} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (\left (- \int \left (\operatorname {Dirac}{\left (t - 2 \pi \right )} + \operatorname {Dirac}{\left (t - \pi \right )}\right ) e^{2 t} \sin {\left (t \right )}\, dt + \int \limits ^{0} \operatorname {Dirac}{\left (t - 2 \pi \right )} e^{2 t} \sin {\left (t \right )}\, dt + \int \limits ^{0} \operatorname {Dirac}{\left (t - \pi \right )} e^{2 t} \sin {\left (t \right )}\, dt\right ) \cos {\left (t \right )} + \left (\int \left (\operatorname {Dirac}{\left (t - 2 \pi \right )} + \operatorname {Dirac}{\left (t - \pi \right )}\right ) e^{2 t} \cos {\left (t \right )}\, dt - \int \limits ^{0} \operatorname {Dirac}{\left (t - 2 \pi \right )} e^{2 t} \cos {\left (t \right )}\, dt - \int \limits ^{0} \operatorname {Dirac}{\left (t - \pi \right )} e^{2 t} \cos {\left (t \right )}\, dt + 2\right ) \sin {\left (t \right )}\right ) e^{- 2 t} \]