7.21.4 problem 4

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

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

Using Laplace method With initial conditions

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

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