14.18.3 problem 3

Internal problem ID [2687]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.11, Differential equations with discontinuous right-hand sides. Excercises page 243
Problem number : 3
Date solved : Monday, January 27, 2025 at 06:06:32 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

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

Solution by Maple

Time used: 1.372 (sec). Leaf size: 33

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

Solution by Mathematica

Time used: 0.046 (sec). Leaf size: 72

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