76.15.36 problem 38

Internal problem ID [17677]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 4. Second order linear equations. Section 4.5 (Nonhomogeneous Equations, Method of Undetermined Coefficients). Problems at page 260
Problem number : 38
Date solved : Tuesday, January 28, 2025 at 10:54:00 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

With initial conditions

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

Solution by Maple

Time used: 21.647 (sec). Leaf size: 64

dsolve([diff(y(t),t$2)+2*diff(y(t),t)+5*y(t)=piecewise(0<=t and t<=Pi/2,1,t>Pi/2,0),y(0) = 0, D(y)(0) = 0],y(t), singsol=all)
 
\[ y = -\frac {\left (\left \{\begin {array}{cc} 0 & t <0 \\ -2+{\mathrm e}^{-t} \left (2 \cos \left (2 t \right )+\sin \left (2 t \right )\right ) & t <\frac {\pi }{2} \\ \left ({\mathrm e}^{-t}+{\mathrm e}^{\frac {\pi }{2}-t}\right ) \left (2 \cos \left (2 t \right )+\sin \left (2 t \right )\right ) & \frac {\pi }{2}\le t \end {array}\right .\right )}{10} \]

Solution by Mathematica

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

DSolve[{D[y[t],{t,2}]+2*D[y[t],t]+5*y[t]==Piecewise[{  {1,0<=t<=Pi/2}, {0,t>Pi/2} }],{y[0]==0,Derivative[1][y][0] == 0}},y[t],t,IncludeSingularSolutions -> True]
 
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ \frac {1}{10} e^{-t} \left (-2 \cos (2 t)+2 e^t-\sin (2 t)\right ) & t>0\land 2 t\leq \pi \\ -\frac {1}{10} e^{-t} \left (1+e^{\pi /2}\right ) (2 \cos (2 t)+\sin (2 t)) & \text {True} \\ \end {array} \\ \end {array} \]