7.6 problem 14

Internal problem ID [5940]

Book: DIFFERENTIAL EQUATIONS with Boundary Value Problems. DENNIS G. ZILL, WARREN S. WRIGHT, MICHAEL R. CULLEN. Brooks/Cole. Boston, MA. 2013. 8th edition.
Section: CHAPTER 7 THE LAPLACE TRANSFORM. 7.4.1 DERIVATIVES OF A TRANSFORM. Page 309
Problem number: 14.
ODE order: 2.
ODE degree: 1.

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

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

Solution by Maple

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

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

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

Solution by Mathematica

Time used: 0.013 (sec). Leaf size: 38

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

\begin{align*} y(t)\to {cc} \{ & {cc} \cos (t) & t\leq 0 \\ 1 & t>0\land 2 t\leq \pi \\ \frac {1}{4} (\pi -2 t) \cos (t)+\sin (t) & \text {True} \\ \\ \\ \\ \\ \end{align*}