76.3.23 problem 28

Internal problem ID [17394]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.4 (Differences between linear and nonlinear equations). Problems at page 79
Problem number : 28
Date solved : Tuesday, January 28, 2025 at 10:04:23 AM
CAS classification : [_separable]

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

With initial conditions

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

Solution by Maple

Time used: 0.811 (sec). Leaf size: 25

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

Solution by Mathematica

Time used: 0.033 (sec). Leaf size: 37

DSolve[{D[y[t],t]+Piecewise[{{2,0<=t<=1},{1,t>1}}]*y[t]==0,{}},y[t],t,IncludeSingularSolutions -> True]
 
\begin{align*} y(t)\to c_1 \exp \left ( \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ -2 t & 0<t\leq 1 \\ -t-1 & \text {True} \\ \end {array} \\ \end {array} \right ) \\ y(t)\to 0 \\ \end{align*}