Internal problem ID [12016]
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).
ODE order: 2.
ODE degree: 1.
CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]
\[ \boxed {y^{\prime \prime }+y=\left \{\begin {array}{cc} t & 0\le t <\pi \\ -t & \pi \le t \end {array}\right .} \] With initial conditions \begin {align*} [y \left (0\right ) = 0, y^{\prime }\left (0\right ) = 0] \end {align*}
✓ Solution by Maple
Time used: 0.047 (sec). Leaf size: 34
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 (t \right ) = \left \{\begin {array}{cc} 0 & t <0 \\ 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.058 (sec). Leaf size: 38
DSolve[{y''[t]+y[t]==Piecewise[{{t,0<=t<Pi},{-t,t>=Pi}}],{y[0]==0,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} \]