67.4.28 problem Problem 4(d)

Internal problem ID [14072]
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 4(d)
Date solved : Tuesday, January 28, 2025 at 06:13:37 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

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

Solution by Maple

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

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

Solution by Mathematica

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

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