74.5.39 problem 43

Internal problem ID [16003]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.3, page 49
Problem number : 43
Date solved : Tuesday, January 28, 2025 at 08:26:14 AM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

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

Solution by Maple

Time used: 0.686 (sec). Leaf size: 33

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

Solution by Mathematica

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

DSolve[{D[y[t],t]+y[t]==Piecewise[{{t,0<=t<1},{0,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 e^{-t} & t>1 \\ t+2 e^{-t}-1 & \text {True} \\ \end {array} \\ \end {array} \]