76.20.1 problem 1

Internal problem ID [17749]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 5. The Laplace transform. Section 5.6 (Differential equations with Discontinuous Forcing Functions). Problems at page 342
Problem number : 1
Date solved : Tuesday, January 28, 2025 at 11:02:09 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\left \{\begin {array}{cc} 1 & 0\le t <\frac {\pi }{2} \\ 0 & \frac {\pi }{2}\le t \end {array}\right . \end{align*}

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=5\\ y^{\prime }\left (0\right )&=3 \end{align*}

Solution by Maple

Time used: 16.767 (sec). Leaf size: 30

dsolve([diff(y(t),t$2)+y(t)=piecewise(0<=t and t<Pi/2, 1, t>=Pi/2 ,0),y(0) = 5, D(y)(0) = 3],y(t), singsol=all)
 
\[ y = 4 \cos \left (t \right )+\left (\left \{\begin {array}{cc} 1+3 \sin \left (t \right ) & t <\frac {\pi }{2} \\ 4 \sin \left (t \right ) & \frac {\pi }{2}\le t \end {array}\right .\right ) \]

Solution by Mathematica

Time used: 0.030 (sec). Leaf size: 47

DSolve[{D[y[t],{t,2}]+y[t]==Piecewise[{  {1,0<=t<Pi/2},{0,t>=Pi/2}}],{y[0]==5,Derivative[1][y][0] ==3}},y[t],t,IncludeSingularSolutions -> True]
 
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} 5 \cos (t)+3 \sin (t) & t\leq 0 \\ 4 \cos (t)+3 \sin (t)+1 & t>0\land 2 t\leq \pi \\ 4 (\cos (t)+\sin (t)) & \text {True} \\ \end {array} \\ \end {array} \]