Internal problem ID [844]
Book: Elementary differential equations and boundary value problems, 11th ed., Boyce, DiPrima,
Meade
Section: Chapter 6.2, The Laplace Transform. Solution of Initial Value Problems. page
255
Problem number: 19.
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 <1 \\ -t +2 & 1\le t <2 \\ 0 & 2\le t <\infty \end {array}\right .} \] With initial conditions \begin {align*} [y \left (0\right ) = 1, y^{\prime }\left (0\right ) = 0] \end {align*}
✓ Solution by Maple
Time used: 0.187 (sec). Leaf size: 59
dsolve([diff(y(t),t$2)+y(t)=piecewise(0<=t and t<1,t,1<=t and t<2,2-t,2<=t and t<infinity,0),y(0) = 1, D(y)(0) = 0],y(t), singsol=all)
\[ y \left (t \right ) = \cos \left (t \right )+\left (\left \{\begin {array}{cc} 0 & t <0 \\ -\sin \left (t \right )+t & t <1 \\ 2 \sin \left (t -1\right )-t -\sin \left (t \right )+2 & t <2 \\ 2 \sin \left (t -1\right )-\sin \left (t \right )-\sin \left (t -2\right ) & 2\le t \end {array}\right .\right ) \]
✓ Solution by Mathematica
Time used: 0.051 (sec). Leaf size: 68
DSolve[{y''[t]+y[t]==Piecewise[{{t,0<t<1},{2-t,1<=t<2},{0,2<=t<Infinity}}],{y[0]==1,y'[0]==0}},y[t],t,IncludeSingularSolutions -> True]
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} \cos (t) & t\leq 0 \\ \cos (t)-4 \sin ^2\left (\frac {1}{2}\right ) \sin (1-t) & t>2 \\ t+\cos (t)-\sin (t) & 0<t\leq 1 \\ -t+\cos (t)-2 \sin (1-t)-\sin (t)+2 & \text {True} \\ \end {array} \\ \end {array} \]