4.19 problem Problem 3(e)

Internal problem ID [10979]

Book: APPLIED DIFFERENTIAL EQUATIONS The Primary Course by Vladimir A. Dobrushkin. CRC Press 2015
Section: Chapter 5.6 Laplace transform. Nonhomogeneous equations. Problems page 368
Problem number: Problem 3(e).
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-5 \cos \left (t \right ) \left (\operatorname {Heaviside}\left (t \right )-\operatorname {Heaviside}\left (t -\frac {\pi }{2}\right )\right )=0} \] With initial conditions \begin {align*} [y \left (0\right ) = 1, y^{\prime }\left (0\right ) = -1] \end {align*}

Solution by Maple

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

dsolve([diff(y(t),t$2)+2*diff(y(t),t)+2*y(t)=5*cos(t)*(Heaviside(t)-Heaviside(t-Pi/2)),y(0) = 1, D(y)(0) = -1],y(t), singsol=all)
 

\[ y \left (t \right ) = -\operatorname {Heaviside}\left (t -\frac {\pi }{2}\right ) \left (\cos \left (t \right )-2 \sin \left (t \right )\right ) {\mathrm e}^{\frac {\pi }{2}-t}+\left (-\cos \left (t \right )-2 \sin \left (t \right )\right ) \operatorname {Heaviside}\left (t -\frac {\pi }{2}\right )+\left (\left (1-\operatorname {Heaviside}\left (t \right )\right ) \cos \left (t \right )-3 \sin \left (t \right ) \operatorname {Heaviside}\left (t \right )\right ) {\mathrm e}^{-t}+\operatorname {Heaviside}\left (t \right ) \left (\cos \left (t \right )+2 \sin \left (t \right )\right ) \]

Solution by Mathematica

Time used: 0.015 (sec). Leaf size: 67

DSolve[{y''[t]+2*y'[t]+2*y[t]==5*Cos[t]*(UnitStep[t]-UnitStep[t-Pi/2]),{y[0]==1,y'[0]==-1}},y[t],t,IncludeSingularSolutions -> True]
 

\begin{align*} y(t)\to {cc} \{ & {cc} e^{-t} \cos (t) & t<0 \\ e^{-t} \left (-e^{\pi /2} (\cos (t)-2 \sin (t))-3 \sin (t)\right ) & 2 t>\pi \\ \cos (t)+\left (2-3 e^{-t}\right ) \sin (t) & \text {True} \\ \\ \\ \\ \\ \end{align*}