5.28 problem 28

Internal problem ID [11665]

Book: Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section: Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number: 28.
ODE order: 1.
ODE degree: 1.

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

\[ \boxed {y^{\prime }+y=\left \{\begin {array}{cc} 5 & 0\le x <10 \\ 1 & 10\le x \end {array}\right .} \] With initial conditions \begin {align*} [y \left (0\right ) = 6] \end {align*}

Solution by Maple

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

dsolve([diff(y(x),x)+y(x)=piecewise(0<=x and x<10,5,x>=10,1),y(0) = 6],y(x), singsol=all)
 

\[ y \left (x \right ) = \left \{\begin {array}{cc} 6 \,{\mathrm e}^{-x} & x <0 \\ {\mathrm e}^{-x}+5 & x <10 \\ {\mathrm e}^{-x}+1+4 \,{\mathrm e}^{10-x} & 10\le x \end {array}\right . \]

Solution by Mathematica

Time used: 0.061 (sec). Leaf size: 45

DSolve[{y'[x]+y[x]==Piecewise[{{5,0<=x<10},{1,x>=10}}],{y[0]==6}},y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \begin {array}{cc} \{ & \begin {array}{cc} 6 e^{-x} & x\leq 0 \\ e^{-x} \left (1+4 e^{10}+e^x\right ) & x>10 \\ 5+e^{-x} & \text {True} \\ \end {array} \\ \end {array} \]