64.20.18 problem 18

Internal problem ID [13661]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 9, The Laplace transform. Section 9.3, Exercises page 452
Problem number : 18
Date solved : Tuesday, January 28, 2025 at 05:54:30 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

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

Solution by Maple

Time used: 12.815 (sec). Leaf size: 26

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

Solution by Mathematica

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

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