76.20.9 problem 9

Internal problem ID [17757]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 5. The Laplace transform. Section 5.6 (Differential equations with Discontinuous Forcing Functions). Problems at page 342
Problem number : 9
Date solved : Tuesday, January 28, 2025 at 11:02:18 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\left \{\begin {array}{cc} \frac {t}{2} & 0\le t <6 \\ 3 & 6\le t \end {array}\right . \end{align*}

Using Laplace method With initial conditions

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

Solution by Maple

Time used: 17.077 (sec). Leaf size: 29

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

Solution by Mathematica

Time used: 0.038 (sec). Leaf size: 63

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