20.22.17 problem Problem 46 part b

Internal problem ID [3972]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 10, The Laplace Transform and Some Elementary Applications. Exercises for 10.7. page 704
Problem number : Problem 46 part b
Date solved : Monday, January 27, 2025 at 08:05:29 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }-y&=\left \{\begin {array}{cc} 2 & 0\le t <1 \\ -1 & 1\le t \end {array}\right . \end{align*}

Using Laplace method With initial conditions

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

Solution by Maple

Time used: 3.571 (sec). Leaf size: 38

dsolve([diff(y(t),t)-y(t)=piecewise(0<=t and t<1,2,t>=1,-1),y(0) = 1],y(t), singsol=all)
 
\[ y = \left \{\begin {array}{cc} -2+3 \,{\mathrm e}^{t} & t <1 \\ 1+3 \,{\mathrm e} & t =1 \\ 1+3 \,{\mathrm e}^{t}-3 \,{\mathrm e}^{-1+t} & 1<t \end {array}\right . \]

Solution by Mathematica

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

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