4.2 problem 2

Internal problem ID [846]

Book: Elementary differential equations and boundary value problems, 11th ed., Boyce, DiPrima, Meade
Section: Chapter 6.4, The Laplace Transform. Differential equations with discontinuous forcing functions. page 268
Problem number: 2.
ODE order: 2.
ODE degree: 1.

CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.5 (sec). Leaf size: 76

dsolve([diff(y(t),t$2)+2*diff(y(t),t)+2*y(t)=piecewise(Pi<=t and t<2*Pi,1,true,0),y(0) = 0, D(y)(0) = 1],y(t), singsol=all)
 

\[ y \left (t \right ) = \left \{\begin {array}{cc} {\mathrm e}^{-t} \sin \left (t \right ) & t <\pi \\ \frac {\left (\cos \left (t \right )+\sin \left (t \right )\right ) {\mathrm e}^{\pi -t}}{2}+{\mathrm e}^{-t} \sin \left (t \right )+\frac {1}{2} & t <2 \pi \\ \frac {{\mathrm e}^{-t} \left (\left (\cos \left (t \right )+\sin \left (t \right )\right ) {\mathrm e}^{2 \pi }+\left (\cos \left (t \right )+\sin \left (t \right )\right ) {\mathrm e}^{\pi }+2 \sin \left (t \right )\right )}{2} & 2 \pi \le t \end {array}\right . \]

Solution by Mathematica

Time used: 0.011 (sec). Leaf size: 82

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

\begin{align*} y(t)\to {cc} \{ & {cc} e^{-t} \sin (t) & t\leq \pi \\ \frac {1}{2} e^{-t} \left (2 \sin (t)+e^t+e^{\pi } (\cos (t)+\sin (t))\right ) & \pi <t\leq 2 \pi \\ \frac {1}{2} e^{-t} \left (2 \sin (t)+e^{\pi } \left (1+e^{\pi }\right ) (\cos (t)+\sin (t))\right ) & \text {True} \\ \\ \\ \\ \\ \end{align*}