57.17.1 problem 2

Internal problem ID [14481]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 3, Laplace transform. Section 3.4 Impulsive sources. Exercises page 173
Problem number : 2
Date solved : Thursday, October 02, 2025 at 09:37:42 AM
CAS classification : [[_linear, `class A`]]

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

Using Laplace method With initial conditions

\begin{align*} x \left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.132 (sec). Leaf size: 38
ode:=diff(x(t),t)+3*x(t) = Dirac(t-1)+Heaviside(t-4); 
ic:=[x(0) = 1]; 
dsolve([ode,op(ic)],x(t),method='laplace');
 
\[ x = \operatorname {Heaviside}\left (t -1\right ) {\mathrm e}^{-3 t +3}-\frac {\operatorname {Heaviside}\left (t -4\right ) {\mathrm e}^{-3 t +12}}{3}+\frac {\operatorname {Heaviside}\left (t -4\right )}{3}+{\mathrm e}^{-3 t} \]
Mathematica. Time used: 0.075 (sec). Leaf size: 53
ode=D[x[t],t]+3*x[t]==DiracDelta[t-1]+UnitStep[t-4]; 
ic={x[0]==1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {1}{3} e^{-3 t} \left (3 e^3 \theta (t-1)+\left (e^{12}-e^{3 t}\right ) \theta (4-t)+e^{3 t}-e^{12}+3\right ) \end{align*}
Sympy. Time used: 0.578 (sec). Leaf size: 63
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-Dirac(t - 1) + 3*x(t) - Heaviside(t - 4) + Derivative(x(t), t),0) 
ics = {x(0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
\[ - \frac {\left (e^{3 t} - e^{12}\right ) \theta \left (t - 4\right )}{3} - \int \operatorname {Dirac}{\left (t - 1 \right )} e^{3 t}\, dt + 3 \int x{\left (t \right )} e^{3 t}\, dt = - \int \limits ^{0} \operatorname {Dirac}{\left (t - 1 \right )} e^{3 t}\, dt + 3 \int \limits ^{0} x{\left (t \right )} e^{3 t}\, dt \]