63.15.12 problem 12

Internal problem ID [13195]
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 : 12
Date solved : Tuesday, January 28, 2025 at 05:12:14 AM
CAS classification : [[_linear, `class A`]]

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

Using Laplace method With initial conditions

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

Solution by Maple

Time used: 8.857 (sec). Leaf size: 20

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

Solution by Mathematica

Time used: 0.058 (sec). Leaf size: 26

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