14.17 problem Problem 46 part b

Internal problem ID [2374]

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.
ODE order: 1.
ODE degree: 1.

CAS Maple gives this as type [[_linear, class A]]

Solve \begin {gather*} \boxed {y^{\prime }-y-\left (\left \{\begin {array}{cc} 2 & 0\le t <1 \\ -1 & 1\le t \end {array}\right .\right )=0} \end {gather*} With initial conditions \begin {align*} [y \relax (0) = 1] \end {align*}

Solution by Maple

Time used: 0.024 (sec). Leaf size: 34

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 \relax (t ) = \left \{\begin {array}{cc} {\mathrm e}^{t} & t <0 \\ 3 \,{\mathrm e}^{t}-2 & t <1 \\ 3 \,{\mathrm e}^{t}+1-3 \,{\mathrm e}^{t -1} & 1\le t \end {array}\right . \]

Solution by Mathematica

Time used: 0.073 (sec). Leaf size: 40

DSolve[{y'[t]-y[t]==Piecewise[{{2,0<=t<1},{-1,t>=1}}],{y[0]==1}},y[t],t,IncludeSingularSolutions -> True]
 

\begin{align*} y(t)\to {cc} \{ & {cc} e^t & t\leq 0 \\ -2+3 e^t & 0<t\leq 1 \\ 1+3 (-1+e) e^{t-1} & \text {True} \\ \\ \\ \\ \\ \end{align*}