7.21.3 problem 3

Internal problem ID [566]
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 : 3
Date solved : Saturday, March 29, 2025 at 04:56:49 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

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

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