This is complete solution of class example (example 2). Math 319, lecture Nov. 30. 2016.
Solve the differential equation\begin{align*} 2y^{\prime \prime }\left ( t\right ) +y^{\prime }\left ( t\right ) +2y\left ( t\right ) & =g\left ( t\right ) \\ y\left ( 0\right ) & =0\\ y^{\prime }\left ( 0\right ) & =0 \end{align*}
Where \[ g\left ( t\right ) =\left \{ \begin{array} [c]{ccc}1 & & 5\leq t<20\\ 0 & & \text{otherwise}\end{array} \right . \] Using Laplace transform method.
Solution
The first step is to find the Laplace transform of the forcing function \(g\left ( t\right ) \). The function \(g\left ( t\right ) \) is
We now write \(g\left ( t\right ) \) in terms of the unit step function \(u_{c}\left ( t\right ) \) defined as \(u_{c}=\left \{ \begin{array} [c]{ccc}0 & & t<c\\ 1 & & t\geq c \end{array} \right . \) as follows\begin{equation} g\left ( t\right ) =u_{5}\left ( t\right ) -u_{20}\left ( t\right ) \tag{1} \end{equation} Now we use the property that \[\mathcal{L}\left \{ u_{c}\left ( t\right ) f\left ( t-c\right ) \right \} =e^{-cs}\mathcal{L}\left \{ f\left ( t\right ) \right \} \] To obtain the Laplace transform of \(g\left ( t\right ) \) in (1) as follows\begin{align*} \mathcal{L}\left \{ g\left ( t\right ) \right \} & =\mathcal{L}\left \{ u_{5}\left ( t\right ) \right \} -\mathcal{L}\left \{ u_{20}\left ( t\right ) \right \} \\ & =e^{-5s}\mathcal{L}\left \{ 1\right \} -e^{-20s}\mathcal{L}\left \{ 1\right \} \end{align*}
But \(\mathcal{L}\left \{ 1\right \} =\frac{1}{s}\), hence the above becomes\begin{align*} \mathcal{L}\left \{ g\left ( t\right ) \right \} & =e^{-5s}\frac{1}{s}-e^{-20s}\frac{1}{s}\\ & =\frac{e^{-5s}-e^{-20s}}{s} \end{align*}
Now that we found \(\mathcal{L}\left \{ g\left ( t\right ) \right \} \), we go back to the original ODE and take the Laplace transform of the ODE, which results in\[\mathcal{L}\left \{ 2y^{\prime \prime }\left ( t\right ) \right \} +\mathcal{L}\left \{ y^{\prime }\left ( t\right ) \right \} +\mathcal{L}\left \{ 2y\left ( t\right ) \right \} =\mathcal{L}\left \{ g\left ( t\right ) \right \} \] Let \(Y\left ( s\right ) =\mathcal{L}\left \{ y\left ( t\right ) \right \} \), then the above becomes\[ 2\left \{ s^{2}Y\left ( s\right ) -sy\left ( 0\right ) -y^{\prime }\left ( 0\right ) \right \} +\left \{ sY\left ( s\right ) -y\left ( 0\right ) \right \} +2Y\left ( s\right ) =\mathcal{L}\left \{ g\left ( t\right ) \right \} \] But \(y\left ( 0\right ) =y^{\prime }\left ( 0\right ) =0\) and the above reduces to\[ 2s^{2}Y\left ( s\right ) +sY\left ( s\right ) +2Y\left ( s\right ) =\frac{e^{-5s}-e^{-20s}}{s}\] Solving for \(Y\left ( s\right ) \) gives\begin{align} Y\left ( s\right ) & =\frac{e^{-5s}-e^{-10s}}{s\left ( 2s^{2}+s+2\right ) }\nonumber \\ & =\left ( \frac{e^{-5s}}{s\left ( 2s^{2}+s+2\right ) }-\frac{e^{-20s}}{s\left ( 2s^{2}+s+2\right ) }\right ) \tag{2} \end{align}
We now need to find the inverse Laplace transform of \(Y\left ( s\right ) \). Looking at \(\frac{e^{-5s}}{s\left ( 2s^{2}+s+2\right ) }\),the first step is to use the property\[ u_{c}\left ( t\right ) f\left ( t-c\right ) \overset{\mathcal{L}}{\Longleftrightarrow }e^{-cs}F\left ( s\right ) \] Comparing the expressions, we see that\begin{equation} u_{5}\left ( t\right ) f\left ( t-c\right ) \Longleftrightarrow \frac{e^{-5s}}{s\left ( 2s^{2}+s+2\right ) }\tag{3} \end{equation} Where\begin{equation} f\left ( t\right ) \Longleftrightarrow \frac{1}{s\left ( 2s^{2}+s+2\right ) }\tag{4} \end{equation} Therefore, we just need to find inverse Laplace transform of \(\frac{1}{s\left ( 2s^{2}+s+2\right ) }\). Using partial fractions\begin{align} \frac{1}{s\left ( 2s^{2}+s+2\right ) } & =\frac{A}{s}+\frac{Bs+C}{2s^{2}+s+2}\tag{5}\\ 1 & =A\left ( 2s^{2}+s+2\right ) +\left ( Bs+C\right ) s\nonumber \\ 1 & =2As^{2}+As+2A+Bs^{2}+Cs\nonumber \\ 1 & =2A+s\left ( A+C\right ) +s^{2}\left ( 2A+B\right ) \nonumber \end{align}
Therefore\begin{align*} A & =\frac{1}{2}\\ A+C & =0\\ 2A+B & =0 \end{align*}
Hence from the second equation \(C=-\frac{1}{2}\), and from the third equation \(B=-1\) Therefore (5) becomes\begin{align} \frac{1}{s\left ( 2s^{2}+s+2\right ) } & =\frac{1}{2}\frac{1}{s}+\frac{-s-\frac{1}{2}}{2s^{2}+s+2}\nonumber \\ & =\frac{1}{2}\frac{1}{s}+\frac{1}{2}\frac{-1-2s}{2s^{2}+s+2}\nonumber \\ & =\frac{1}{2}\frac{1}{s}-\frac{s}{2s^{2}+s+2}-\frac{1}{2}\frac{1}{2s^{2}+s+2}\tag{5A} \end{align}
The first term above is easy, we know that\begin{equation} \frac{1}{2}\frac{1}{s}\Longleftrightarrow \frac{1}{2}\tag{6} \end{equation} Now we will find inverse Laplace transform of second term in (5A) \(\frac{s}{2s^{2}+s+2}\). For this we start by completing the squares in the denominator. Let\begin{align*} 2s^{2}+s+2 & =a\left ( s+b\right ) ^{2}+c\\ & =a\left ( s^{2}+b^{2}+2bs\right ) +c\\ & =as^{2}+ab^{2}+2bas+c \end{align*}
Hence \(a=2,2ab=1\) or \(b=\frac{1}{4}\) and \(ab^{2}+c=2\), hence \(c=2-2\left ( \frac{1}{4}\right ) ^{2}=2-2\left ( \frac{1}{16}\right ) =2-\frac{1}{8}=\frac{15}{8}\), Therefore\[ 2s^{2}+s+2=2\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{8}\] We now re-write second term in (5A), which is \(\frac{s}{2s^{2}+s+2}\) as \(\frac{s}{2\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{8}}\). We did this because we wanted this to be in the form \(\frac{s}{s^{2}+a}\), therefore\[ \frac{s}{2\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{8}}=\frac{1}{2}\frac{s}{\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{16}}\] Now we let \(\tilde{s}=s+\frac{1}{4}\), therefore the above becomes\begin{equation} \frac{1}{2}\frac{\tilde{s}-\frac{1}{4}}{\tilde{s}^{2}+\frac{15}{16}}=\frac{1}{2}\left ( \frac{\tilde{s}}{\tilde{s}^{2}+\frac{15}{16}}-\frac{1}{4}\frac{1}{\tilde{s}^{2}+\frac{15}{16}}\right ) \tag{7} \end{equation} Using \(\frac{s}{s^{2}+a^{2}}\Leftrightarrow \cos \left ( at\right ) \) then \[ \frac{\tilde{s}}{\tilde{s}^{2}+\frac{15}{16}}\Leftrightarrow e^{-\frac{t}{4}}\cos \left ( \sqrt{\frac{15}{16}}t\right ) \] The reason for \(e^{-\frac{t}{4}}\) being there, is because we evaluated \(F\left ( s\right ) \) at \(F\left ( s+\frac{1}{4}\right ) \). This used the shift property \[ F\left ( s+a\right ) =e^{-at}f\left ( t\right ) \] Therefore \(F\left ( s+\frac{1}{4}\right ) =e^{-\frac{t}{4}}f\left ( t\right ) \). Now we do the second term in (7). Since \(\frac{1}{\tilde{s}^{2}+\frac{15}{16}}=\frac{1}{\sqrt{\frac{15}{16}}}\frac{\sqrt{\frac{15}{16}}}{\tilde{s}^{2}+\frac{15}{16}}\), then, now using \(\frac{a}{s^{2}+a^{2}}\Leftrightarrow \sin \left ( at\right ) \) we obtain\[ \frac{1}{\sqrt{\frac{15}{16}}}\frac{\sqrt{\frac{15}{16}}}{\tilde{s}^{2}+\frac{15}{16}}\Leftrightarrow \frac{1}{\sqrt{\frac{15}{16}}}e^{-\frac{t}{4}}\sin \left ( \sqrt{\frac{15}{16}}t\right ) \] And we remember to add \(e^{-\frac{t}{4}}\) again, due to the shift in \(s\). Therefore (7) becomes\begin{align} \frac{s}{2s^{2}+s+2} & \Leftrightarrow \frac{1}{2}\left ( e^{-\frac{t}{4}}\cos \left ( \sqrt{\frac{15}{16}}t\right ) -\frac{1}{4}e^{-\frac{t}{4}}\frac{1}{\sqrt{\frac{15}{16}}}\sin \left ( \sqrt{\frac{15}{16}}t\right ) \right ) \nonumber \\ & =\frac{e^{-\frac{t}{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}t\right ) -\sin \left ( \frac{\sqrt{15}}{4}t\right ) \right ) \tag{8} \end{align}
This complete the second term in (5A). Now we will do the third term in (5A) which is \(\frac{1}{2s^{2}+s+2}\) which is\begin{align*} \frac{1}{2s^{2}+s+2} & =\frac{1}{2\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{8}}\\ & =\frac{1}{2}\frac{1}{\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{16}}\\ & =\frac{1}{2\sqrt{\frac{15}{16}}}\frac{\sqrt{\frac{15}{16}}}{\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{16}} \end{align*}
Hence\begin{align} \frac{1}{2\sqrt{\frac{15}{16}}}\frac{\sqrt{\frac{15}{16}}}{\left ( s+\frac{1}{4}\right ) ^{2}+\frac{15}{16}} & \Longleftrightarrow \frac{1}{2\sqrt{\frac{15}{16}}}e^{-\frac{t}{4}}\sin \left ( \sqrt{\frac{15}{16}}t\right ) \nonumber \\ & =\frac{2}{\sqrt{15}}e^{-\frac{t}{4}}\sin \left ( \frac{\sqrt{15}}{4}t\right ) \tag{9} \end{align}
Now we put all the results back together.\begin{align*} \frac{1}{s\left ( 2s^{2}+s+2\right ) } & =\frac{1}{2}\frac{1}{s}-\frac{s}{2s^{2}+s+2}-\frac{1}{2}\frac{1}{2s^{2}+s+2}\\ & \Longleftrightarrow \frac{1}{2}-\frac{e^{-\frac{t}{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}t\right ) -\sin \left ( \frac{\sqrt{15}}{4}t\right ) \right ) -\frac{1}{2}\left ( \frac{2}{\sqrt{15}}e^{-\frac{t}{4}}\sin \left ( \frac{\sqrt{15}}{4}t\right ) \right ) \end{align*}
We can simplify this more\begin{align*} \frac{1}{s\left ( 2s^{2}+s+2\right ) } & \Longleftrightarrow \frac{1}{2}-\frac{e^{-\frac{t}{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}t\right ) -\sin \left ( \frac{\sqrt{15}}{4}t\right ) +2\sin \left ( \frac{\sqrt{15}}{4}t\right ) \right ) \\ & =\frac{1}{2}-\frac{e^{-\frac{t}{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}t\right ) +\sin \left ( \frac{\sqrt{15}}{4}t\right ) \right ) \end{align*}
Using this back in (2), where we want to evaluates \(\frac{e^{-5s}}{s\left ( 2s^{2}+s+2\right ) }\), gives\[ \frac{e^{-5s}}{s\left ( 2s^{2}+s+2\right ) }\Longleftrightarrow u_{5}\left ( t\right ) f\left ( t-5\right ) \] Where \[ f\left ( t-5\right ) =\frac{1}{2}-\frac{e^{\frac{-\left ( t-5\right ) }{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}\left ( t-5\right ) \right ) +\sin \left ( \frac{\sqrt{15}}{4}\left ( t-5\right ) \right ) \right ) \] The above complete the first term in (2). The second term in (2) is the same, but the delay now is \(20\) instead of \(5\). Hence\[ \frac{e^{-20s}}{s\left ( 2s^{2}+s+2\right ) }\Longleftrightarrow u_{20}\left ( t\right ) f\left ( t-20\right ) \] With the same function \(f\left ( t\right ) \) found above. Therefore, the final inverse transform now is\begin{align*} y\left ( t\right ) & \Longleftrightarrow \left ( \frac{e^{-5s}}{s\left ( 2s^{2}+s+2\right ) }-\frac{e^{-20s}}{s\left ( 2s^{2}+s+2\right ) }\right ) \\ & =\left ( u_{5}\left ( t\right ) f\left ( t-5\right ) -u_{20}\left ( t\right ) f\left ( t-20\right ) \right ) \end{align*}
Where\[ f\left ( t-20\right ) =\frac{1}{2}-\frac{e^{\frac{-\left ( t-20\right ) }{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}\left ( t-20\right ) \right ) +\sin \left ( \frac{\sqrt{15}}{4}\left ( t-20\right ) \right ) \right ) \] This complete the solution. The final solution is \begin{align*} y\left ( t\right ) & =u_{5}\left ( t\right ) \left ( \frac{1}{2}-\frac{e^{\frac{-\left ( t-5\right ) }{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}\left ( t-5\right ) \right ) +\sin \left ( \frac{\sqrt{15}}{4}\left ( t-5\right ) \right ) \right ) \right ) \\ & -u_{20}\left ( t\right ) \left ( \frac{1}{2}-\frac{e^{\frac{-\left ( t-20\right ) }{4}}}{2\sqrt{15}}\left ( \sqrt{15}\cos \left ( \frac{\sqrt{15}}{4}\left ( t-20\right ) \right ) +\sin \left ( \frac{\sqrt{15}}{4}\left ( t-20\right ) \right ) \right ) \right ) \end{align*}
Here is a plot of the above solution
References