4.1 problem 1

Internal problem ID [845]

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: 1.
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 <3 \pi \\ 0 & 3 \pi \le t <\infty \end {array}\right .\right )=0} \end {gather*} With initial conditions \begin {align*} [y \relax (0) = 0, y^{\prime }\relax (0) = 1] \end {align*}

Solution by Maple

Time used: 0.096 (sec). Leaf size: 32

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

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

Solution by Mathematica

Time used: 0.008 (sec). Leaf size: 34

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

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