4.6 problem 6

4.6.1 Existence and uniqueness analysis
4.6.2 Maple step by step solution

Internal problem ID [850]
Internal file name [OUTPUT/850_Sunday_June_05_2022_01_51_27_AM_71448528/index.tex]

Book: Elementary differential equations and boundary value problems, 11th ed., Boyce, DiPrima, Meade
Section: Chapter 6.4, The Laplace Transform. Differential equations with discontinuous forcing functions. page 268
Problem number: 6.
ODE order: 2.
ODE degree: 1.

The type(s) of ODE detected by this program : "second_order_laplace", "second_order_linear_constant_coeff"

Maple gives the following as the ode type

[[_2nd_order, _linear, _nonhomogeneous]]

\[ \boxed {y^{\prime \prime }+y^{\prime }+\frac {5 y}{4}=\left \{\begin {array}{cc} \sin \left (t \right ) & 0\le t <\pi \\ 0 & \operatorname {otherwise} \end {array}\right .} \] With initial conditions \begin {align*} [y \left (0\right ) = 0, y^{\prime }\left (0\right ) = 0] \end {align*}

4.6.1 Existence and uniqueness analysis

This is a linear ODE. In canonical form it is written as \begin {align*} y^{\prime \prime } + p(t)y^{\prime } + q(t) y &= F \end {align*}

Where here \begin {align*} p(t) &=1\\ q(t) &={\frac {5}{4}}\\ F &=\left \{\begin {array}{cc} 0 & t <0 \\ \sin \left (t \right ) & t <\pi \\ 0 & \pi \le t \end {array}\right . \end {align*}

Hence the ode is \begin {align*} y^{\prime \prime }+y^{\prime }+\frac {5 y}{4} = \left \{\begin {array}{cc} 0 & t <0 \\ \sin \left (t \right ) & t <\pi \\ 0 & \pi \le t \end {array}\right . \end {align*}

The domain of \(p(t)=1\) is \[ \{-\infty

Solving using the Laplace transform method. Let \begin {align*} \mathcal {L}\left (y\right ) =Y(s) \end {align*}

Taking the Laplace transform of the ode and using the relations that \begin {align*} \mathcal {L}\left (y^{\prime }\right ) &= s Y(s) - y \left (0\right )\\ \mathcal {L}\left (y^{\prime \prime }\right ) &= s^2 Y(s) - y'(0) - s y \left (0\right ) \end {align*}

The given ode now becomes an algebraic equation in the Laplace domain \begin {align*} s^{2} Y \left (s \right )-y^{\prime }\left (0\right )-s y \left (0\right )+s Y \left (s \right )-y \left (0\right )+\frac {5 Y \left (s \right )}{4} = \frac {1+{\mathrm e}^{-s \pi }}{s^{2}+1}\tag {1} \end {align*}

But the initial conditions are \begin {align*} y \left (0\right )&=0\\ y'(0) &=0 \end {align*}

Substituting these initial conditions in above in Eq (1) gives \begin {align*} s^{2} Y \left (s \right )+s Y \left (s \right )+\frac {5 Y \left (s \right )}{4} = \frac {1+{\mathrm e}^{-s \pi }}{s^{2}+1} \end {align*}

Solving the above equation for \(Y(s)\) results in \begin {align*} Y(s) = \frac {4+4 \,{\mathrm e}^{-s \pi }}{\left (s^{2}+1\right ) \left (4 s^{2}+4 s +5\right )} \end {align*}

Taking the inverse Laplace transform gives \begin {align*} y&= \mathcal {L}^{-1}\left (Y(s)\right )\\ &= \mathcal {L}^{-1}\left (\frac {4+4 \,{\mathrm e}^{-s \pi }}{\left (s^{2}+1\right ) \left (4 s^{2}+4 s +5\right )}\right )\\ &= \frac {8 \left (-\sin \left (t \right ) \cosh \left (-\frac {\pi }{4}+\frac {t}{4}\right )+4 \cos \left (t \right ) \sinh \left (-\frac {\pi }{4}+\frac {t}{4}\right )\right ) \operatorname {Heaviside}\left (t -\pi \right ) {\mathrm e}^{\frac {\pi }{4}-\frac {t}{4}}}{17}+\frac {8 \left (-4 \cos \left (t \right ) \sinh \left (\frac {t}{4}\right )+\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )\right ) {\mathrm e}^{-\frac {t}{4}}}{17} \end {align*}

Converting the above solution to piecewise it becomes \[ y = \left \{\begin {array}{cc} \frac {8 \left (-4 \cos \left (t \right ) \sinh \left (\frac {t}{4}\right )+\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )\right ) {\mathrm e}^{-\frac {t}{4}}}{17} & t <\pi \\ \frac {8 \left (-4 \cos \left (t \right ) \sinh \left (\frac {t}{4}\right )+\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )\right ) {\mathrm e}^{-\frac {t}{4}}}{17}+\frac {8 \left (-\sin \left (t \right ) \cosh \left (-\frac {\pi }{4}+\frac {t}{4}\right )+4 \cos \left (t \right ) \sinh \left (-\frac {\pi }{4}+\frac {t}{4}\right )\right ) {\mathrm e}^{\frac {\pi }{4}-\frac {t}{4}}}{17} & \pi \le t \end {array}\right . \] Simplifying the solution gives \[ y = \frac {4 \left (\left \{\begin {array}{cc} -8 \,{\mathrm e}^{-\frac {t}{4}} \left (\cos \left (t \right ) \sinh \left (\frac {t}{4}\right )-\frac {\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )}{4}\right ) & t <\pi \\ \left ({\mathrm e}^{-\frac {t}{2}}-{\mathrm e}^{\frac {\pi }{2}-\frac {t}{2}}\right ) \left (4 \cos \left (t \right )+\sin \left (t \right )\right ) & \pi \le t \end {array}\right .\right )}{17} \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \frac {4 \left (\left \{\begin {array}{cc} -8 \,{\mathrm e}^{-\frac {t}{4}} \left (\cos \left (t \right ) \sinh \left (\frac {t}{4}\right )-\frac {\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )}{4}\right ) & t <\pi \\ \left ({\mathrm e}^{-\frac {t}{2}}-{\mathrm e}^{\frac {\pi }{2}-\frac {t}{2}}\right ) \left (4 \cos \left (t \right )+\sin \left (t \right )\right ) & \pi \le t \end {array}\right .\right )}{17} \\ \end{align*}

Verification of solutions

\[ y = \frac {4 \left (\left \{\begin {array}{cc} -8 \,{\mathrm e}^{-\frac {t}{4}} \left (\cos \left (t \right ) \sinh \left (\frac {t}{4}\right )-\frac {\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )}{4}\right ) & t <\pi \\ \left ({\mathrm e}^{-\frac {t}{2}}-{\mathrm e}^{\frac {\pi }{2}-\frac {t}{2}}\right ) \left (4 \cos \left (t \right )+\sin \left (t \right )\right ) & \pi \le t \end {array}\right .\right )}{17} \] Verified OK.

4.6.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d}{d t}y^{\prime }+y^{\prime }+\frac {5 y}{4}=\left \{\begin {array}{cc} 0 & t <0 \\ \sin \left (t \right ) & t <\pi \\ 0 & \pi \le t \end {array}\right ., y \left (0\right )=0, y^{\prime }{\raise{-0.36em}{\Big |}}{\mstack {}{_{\left \{t \hiderel {=}0\right \}}}}=0\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d}{d t}y^{\prime } \\ \bullet & {} & \textrm {Characteristic polynomial of homogeneous ODE}\hspace {3pt} \\ {} & {} & r^{2}+r +\frac {5}{4}=0 \\ \bullet & {} & \textrm {Use quadratic formula to solve for}\hspace {3pt} r \\ {} & {} & r =\frac {\left (-1\right )\pm \left (\sqrt {-4}\right )}{2} \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (-\frac {1}{2}-\mathrm {I}, -\frac {1}{2}+\mathrm {I}\right ) \\ \bullet & {} & \textrm {1st solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{1}\left (t \right )={\mathrm e}^{-\frac {t}{2}} \cos \left (t \right ) \\ \bullet & {} & \textrm {2nd solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{2}\left (t \right )={\mathrm e}^{-\frac {t}{2}} \sin \left (t \right ) \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & y=c_{1} y_{1}\left (t \right )+c_{2} y_{2}\left (t \right )+y_{p}\left (t \right ) \\ \bullet & {} & \textrm {Substitute in solutions of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y=c_{1} {\mathrm e}^{-\frac {t}{2}} \cos \left (t \right )+c_{2} {\mathrm e}^{-\frac {t}{2}} \sin \left (t \right )+y_{p}\left (t \right ) \\ \square & {} & \textrm {Find a particular solution}\hspace {3pt} y_{p}\left (t \right )\hspace {3pt}\textrm {of the ODE}\hspace {3pt} \\ {} & \circ & \textrm {Use variation of parameters to find}\hspace {3pt} y_{p}\hspace {3pt}\textrm {here}\hspace {3pt} f \left (t \right )\hspace {3pt}\textrm {is the forcing function}\hspace {3pt} \\ {} & {} & \left [y_{p}\left (t \right )=-y_{1}\left (t \right ) \left (\int \frac {y_{2}\left (t \right ) f \left (t \right )}{W \left (y_{1}\left (t \right ), y_{2}\left (t \right )\right )}d t \right )+y_{2}\left (t \right ) \left (\int \frac {y_{1}\left (t \right ) f \left (t \right )}{W \left (y_{1}\left (t \right ), y_{2}\left (t \right )\right )}d t \right ), f \left (t \right )=\left \{\begin {array}{cc} 0 & t <0 \\ \sin \left (t \right ) & t <\pi \\ 0 & \pi \le t \end {array}\right .\right ] \\ {} & \circ & \textrm {Wronskian of solutions of the homogeneous equation}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (t \right ), y_{2}\left (t \right )\right )=\left [\begin {array}{cc} {\mathrm e}^{-\frac {t}{2}} \cos \left (t \right ) & {\mathrm e}^{-\frac {t}{2}} \sin \left (t \right ) \\ -\frac {{\mathrm e}^{-\frac {t}{2}} \cos \left (t \right )}{2}-{\mathrm e}^{-\frac {t}{2}} \sin \left (t \right ) & -\frac {{\mathrm e}^{-\frac {t}{2}} \sin \left (t \right )}{2}+{\mathrm e}^{-\frac {t}{2}} \cos \left (t \right ) \end {array}\right ] \\ {} & \circ & \textrm {Compute Wronskian}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (t \right ), y_{2}\left (t \right )\right )={\mathrm e}^{-t} \\ {} & \circ & \textrm {Substitute functions into equation for}\hspace {3pt} y_{p}\left (t \right ) \\ {} & {} & y_{p}\left (t \right )={\mathrm e}^{-\frac {t}{2}} \left (-\cos \left (t \right ) \left (\int \left (\left \{\begin {array}{cc} 0 & t <0 \\ \sin \left (t \right )^{2} {\mathrm e}^{\frac {t}{2}} & t <\pi \\ 0 & \pi \le t \end {array}\right .\right )d t \right )+\sin \left (t \right ) \left (\int \left (\left \{\begin {array}{cc} 0 & t <0 \\ \frac {\sin \left (2 t \right ) {\mathrm e}^{\frac {t}{2}}}{2} & t <\pi \\ 0 & \pi \le t \end {array}\right .\right )d t \right )\right ) \\ {} & \circ & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & y_{p}\left (t \right )=\frac {4 \left (\left \{\begin {array}{cc} 0 & t \le 0 \\ \left (4 \cos \left (t \right )+\sin \left (t \right )\right ) {\mathrm e}^{-\frac {t}{2}}-4 \cos \left (t \right )+\sin \left (t \right ) & t \le \pi \\ -\left (4 \cos \left (t \right )+\sin \left (t \right )\right ) {\mathrm e}^{-\frac {t}{2}} \left (-1+{\mathrm e}^{\frac {\pi }{2}}\right ) & \pi

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
trying differential order: 2; linear nonhomogeneous with symmetry [0,1] 
trying a double symmetry of the form [xi=0, eta=F(x)] 
-> Try solving first the homogeneous part of the ODE 
   checking if the LODE has constant coefficients 
   <- constant coefficients successful 
<- solving first the homogeneous part of the ODE successful`
 

Solution by Maple

Time used: 0.532 (sec). Leaf size: 91

dsolve([diff(y(t),t$2)+diff(y(t),t)+5/4*y(t)=piecewise(0<=t and t<Pi,sin(t),true,0),y(0) = 0, D(y)(0) = 0],y(t), singsol=all)
 

\[ y \left (t \right ) = \frac {4 \left (\left \{\begin {array}{cc} -8 \,{\mathrm e}^{-\frac {t}{4}} \left (\cos \left (t \right ) \sinh \left (\frac {t}{4}\right )-\frac {\sin \left (t \right ) \cosh \left (\frac {t}{4}\right )}{4}\right ) & t <\pi \\ \left (-{\mathrm e}^{-\frac {t}{2}+\frac {\pi }{2}}+{\mathrm e}^{-\frac {t}{2}}\right ) \left (4 \cos \left (t \right )+\sin \left (t \right )\right ) & \pi \le t \end {array}\right .\right )}{17} \]

Solution by Mathematica

Time used: 0.129 (sec). Leaf size: 77

DSolve[{y''[t]+y'[t]+5/4*y[t]==Piecewise[{{Sin[t],0<=t<Pi},{0,True}}],{y[0]==0,y'[0]==0}},y[t],t,IncludeSingularSolutions -> True]
 

\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ \frac {4}{17} \left (\left (-4+4 e^{-t/2}\right ) \cos (t)+\left (1+e^{-t/2}\right ) \sin (t)\right ) & 0