63.15.13 problem 14

Internal problem ID [13196]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 3, Laplace transform. Section 3.2.1 Initial value problems. Exercises page 156
Problem number : 14
Date solved : Tuesday, January 28, 2025 at 05:12:15 AM
CAS classification : [[_linear, `class A`]]

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

Using Laplace method With initial conditions

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

Solution by Maple

Time used: 9.735 (sec). Leaf size: 42

dsolve([diff(x(t),t)=-x(t)+Heaviside(t-1)-Heaviside(t-2),x(0) = 1],x(t), singsol=all)
 
\[ x \left (t \right ) = -\operatorname {Heaviside}\left (t -1\right ) {\mathrm e}^{1-t}+\operatorname {Heaviside}\left (t -2\right ) {\mathrm e}^{-t +2}+\operatorname {Heaviside}\left (t -1\right )+{\mathrm e}^{-t}-\operatorname {Heaviside}\left (t -2\right ) \]

Solution by Mathematica

Time used: 0.066 (sec). Leaf size: 48

DSolve[{D[x[t],t]==-x[t]+UnitStep[t-1]-UnitStep[t-2],{x[0]==1}},x[t],t,IncludeSingularSolutions -> True]
 
\[ x(t)\to \begin {array}{cc} \{ & \begin {array}{cc} e^{-t} & t\leq 1 \\ e^{-t} \left (1-e+e^2\right ) & t>2 \\ e^{-t} \left (1-e+e^t\right ) & \text {True} \\ \end {array} \\ \end {array} \]