3.12 problem 19

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]]

Solve \begin {gather*} \boxed {y^{\prime \prime }+y-\left (\left \{\begin {array}{cc} t & 0\le t <1 \\ -t +2 & 1\le t <2 \\ 0 & 2\le t <\infty \end {array}\right .\right )=0} \end {gather*} With initial conditions \begin {align*} [y \relax (0) = 1, y^{\prime }\relax (0) = 0] \end {align*}

Solution by Maple

Time used: 0.125 (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 \relax (t ) = \cos \relax (t )+\left (\left \{\begin {array}{cc} 0 & t <0 \\ t -\sin \relax (t ) & t <1 \\ 2 \sin \left (t -1\right )-\sin \relax (t )-t +2 & t <2 \\ 2 \sin \left (t -1\right )-\sin \left (t -2\right )-\sin \relax (t ) & 2\le t \end {array}\right .\right ) \]

Solution by Mathematica

Time used: 0.021 (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]
 

\begin{align*} y(t)\to {cc} \{ & {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{align*}