ode internal name "second order laplace"
These are solved using Laplace transform. These are only solved using this method if
’hint’="laplace" is given.
4.3.1.3.1 Example 1
\begin{align*} y^{\prime \prime }+2y^{\prime }+y & =0\\ y\left ( 1\right ) & =2\\ y^{\prime }\left ( 0\right ) & =2 \end{align*}
Taking Laplace transform gives
\begin{align*} \left ( s^{2}Y-sy\left ( 0\right ) -y^{\prime }\left ( 0\right ) \right ) +2\left ( sY-y\left ( 0\right ) \right ) +Y & =0\\ \left ( s^{2}Y-sy\left ( 0\right ) -2\right ) +\left ( 2sY-2y\left ( 0\right ) \right ) +Y & =0 \end{align*}
Since not all initial conditions are at zero, and we need to have them at zero to use Laplace,
then one way is to let \(y\left ( 0\right ) =y_{0}\) as unknown (we could also have used \(y\left ( 0\right ) =c_{1}\)). Find the solution,
then solve for \(y_{0}\) using the initial condition \(y\left ( 1\right ) =2\). This shows how it is done. The above
becomes
\begin{align*} \left ( s^{2}Y-sy_{0}-2\right ) +\left ( 2sY-2y_{0}\right ) +Y & =0\\ Y\left ( s^{2}+2s+1\right ) -sy_{0}-2-2y_{0} & =0\\ Y & =\frac {sy_{0}+2+2y_{0}}{s^{2}+2s+1}\end{align*}
Applying inverse Laplace transform gives
\begin{equation} y\left ( t\right ) =\left ( y_{0}+2t+y_{0}t\right ) e^{-t} \tag {1}\end{equation}
But \(y\left ( 1\right ) =2\) hence
\begin{align*} 2 & =\left ( y_{0}+2+y_{0}\right ) e^{-1}\\ 2e & =2y_{0}+2\\ y_{0} & =e-1 \end{align*}
Therefore (1) becomes
\begin{align*} y\left ( t\right ) & =\left ( e-1+2t+\left ( e-1\right ) t\right ) e^{-t}\\ & =e^{-t}\left ( -1+e+t+et\right ) \end{align*}
4.3.1.3.2 Example 2
\begin{align*} y^{\prime \prime }-2y^{\prime }-3y & =0\\ y\left ( 4\right ) & =-3\\ y^{\prime }\left ( 4\right ) & =-17 \end{align*}
Taking Laplace transform gives
\[ \left ( s^{2}Y-sy\left ( 0\right ) -y^{\prime }\left ( 0\right ) \right ) -2\left ( sY-y\left ( 0\right ) \right ) -3Y=0 \]
Since given initial conditions are not at \(t=0\), then let \(y\left ( 0\right ) =c_{1},y^{\prime }\left ( 0\right ) =c_{2}\) and the
above becomes
\begin{align*} \left ( s^{2}Y-sc_{1}-c_{2}\right ) -2\left ( sY-c_{1}\right ) -3Y & =0\\ Y\left ( s^{2}-2s-3\right ) -sc_{1}-c_{2}+2c_{1} & =0\\ Y & =\frac {sc_{1}+c_{2}-2c_{1}}{s^{2}-2s-3}\end{align*}
Taking inverse Laplace gives
\begin{equation} y\left ( t\right ) =\frac {1}{4}e^{-t}\left ( c_{2}\left ( e^{4t}-1\right ) +c_{1}\left ( 3+e^{4t}\right ) \right ) \tag {1}\end{equation}
Hence
\begin{equation} y^{\prime }\left ( t\right ) =\frac {1}{4}e^{-t}(4c_{1}e^{-4t}+4c_{2}e^{4t})-\frac {1}{4}e^{-t}(c_{2}(-1+e^{4t})+c_{1}(3+e^{4t})) \tag {2}\end{equation}
At \(t=4\) then (1,2) become
\begin{align*} -3 & =\frac {1}{4}e^{-4}\left ( c_{2}\left ( e^{16}-1\right ) +c_{1}\left ( 3+e^{16}\right ) \right ) \\ -17 & =\frac {1}{4}e^{-4}(4c_{1}e^{-16}+4c_{2}e^{16})-\frac {1}{4}e^{-4}(c_{2}(-1+e^{16})+c_{1}(3+e^{16})) \end{align*}
Solving the above for \(c_{1},c_{2}\) gives
\begin{align*} c_{1} & =\frac {-5+2e^{16}}{e^{12}}\\ c_{2} & =\frac {-15-2e^{16}}{e^{12}}\end{align*}
Hence the solution (1) becomes
\begin{align*} y\left ( t\right ) & =\frac {1}{4}e^{-t}\left ( \frac {-15-2e^{16}}{e^{12}}\left ( e^{4t}-1\right ) +\frac {-5+2e^{16}}{e^{12}}\left ( 3+e^{4t}\right ) \right ) \\ & =-e^{3t}\left ( 5e^{-12}-2e^{4}e^{-4t}\right ) \\ & =-5e^{3t-12}+2e^{4-t}\end{align*}
4.3.1.3.3 Example 3
\begin{align*} y^{\prime \prime }+2y^{\prime }+5y & =50t-100\\ y\left ( 2\right ) & =-4\\ y^{\prime }\left ( 2\right ) & =14 \end{align*}
Taking Laplace transform gives
\[ \left ( s^{2}Y-sy\left ( 0\right ) -y^{\prime }\left ( 0\right ) \right ) +2\left ( sY-y\left ( 0\right ) \right ) +5Y=\frac {50}{s^{2}}-\frac {100}{s}\]
Since given initial conditions are not at \(t=0\), then let \(y\left ( 0\right ) =c_{1},y^{\prime }\left ( 0\right ) =c_{2}\) and the
above becomes
\begin{align*} \left ( s^{2}Y-sc_{1}-c_{2}\right ) +2\left ( sY-c_{1}\right ) +5Y & =\frac {50}{s^{2}}-\frac {100}{s}\\ Y\left ( s^{2}+2s+5\right ) -sc_{1}-c_{2}-2c_{1} & =\frac {50}{s^{2}}-\frac {100}{s}\\ Y & =\frac {sc_{1}+c_{2}+2c_{1}+\frac {50}{s^{2}}-\frac {100}{s}}{s^{2}+2s+5}\end{align*}
Taking inverse Laplace gives
\begin{equation} y\left ( t\right ) =-24+10t+\left ( 24+c_{1}\right ) e^{-t}\cos \left ( 2t\right ) +\left ( 14+c_{1}+c_{2}\right ) e^{-t}\cos t\sin t \tag {1}\end{equation}
Hence
\begin{equation} y^{\prime }\left ( t\right ) =e^{-t}\left ( 10e^{t}+\left ( c_{2}-10\right ) \cos \left ( 2t\right ) -\left ( 110+5c_{1}+c_{2}\right ) \cos t\sin t\right ) \tag {2}\end{equation}
At \(t=2\) then (1,2) become
\begin{align*} -4 & =-24+20+\left ( 24+c_{1}\right ) e^{-2}\cos \left ( 4\right ) +\left ( 14+c_{1}+c_{2}\right ) e^{-2}\cos 2\sin 2\\ 14 & =e^{-2}\left ( 10e^{2}+\left ( c_{2}-10\right ) \cos \left ( 4\right ) -\left ( 110+5c_{1}+c_{2}\right ) \cos 2\sin 2\right ) \end{align*}
Solving the above for \(c_{1},c_{2}\) gives
\begin{align*} c_{1} & =-2\left ( 12+e^{2}\sin 4\right ) \\ c_{2} & =2\left ( 5+e^{2}\left ( 2\cos 4+\sin 4\right ) \right ) \end{align*}
Hence the solution (1) becomes
\[ y\left ( t\right ) =-24+10t+\left ( 24-2\left ( 12+e^{2}\sin 4\right ) \right ) e^{-t}\cos \left ( 2t\right ) +\left ( 14-2\left ( 12+e^{2}\sin 4\right ) +2\left ( 5+e^{2}\left ( 2\cos 4+\sin 4\right ) \right ) \right ) e^{-t}\cos t\sin t \]
Which simplifies to
\[ y\left ( t\right ) =-24+10t-2e^{2-t}\sin \left ( 4-2t\right ) \]
4.3.1.3.4 Example 4
\begin{align*} y^{\prime \prime }+2y^{\prime }+10y & =\delta \left ( t\right ) \\ y\left ( 0\right ) & =0\\ y^{\prime }\left ( 0\right ) & =0 \end{align*}
Taking Laplace transform gives
\[ \left ( s^{2}Y-sy\left ( 0\right ) -y^{\prime }\left ( 0\right ) \right ) +2\left ( sY-y\left ( 0\right ) \right ) +10Y=1 \]
Since given initial conditions then the above becomes
\begin{align*} s^{2}Y+2sY+10Y & =1\\ Y & =\frac {1}{s^{2}+2s+10}\\ & =\frac {1}{\left ( s+2\right ) \left ( s+5\right ) }\end{align*}
Taking inverse Laplace transform gives
\begin{align*} y & =\frac {1}{6}ie^{\left ( -1-3i\right ) t}-\frac {1}{6}ie^{\left ( -1+3i\right ) t}\\ & =\frac {1}{6}ie^{-t}e^{-3it}-\frac {1}{6}ie^{-t}e^{3it}\\ & =\frac {1}{6}ie^{-t}\left ( e^{-3it}-e^{3it}\right ) \\ & =\frac {1}{6}ie^{-t}\left ( \cos 3t-i\sin 3t-\left ( \cos 3t+i\sin 3t\right ) \right ) \\ & =\frac {1}{6}ie^{-t}\left ( -i\sin 3t-i\sin 3t\right ) \\ & =\frac {1}{6}ie^{-t}\left ( -2i\sin 3t\right ) \\ & =\frac {1}{3}e^{-t}\sin 3t \end{align*}
Which is the same as
\[ y=\left ( \frac {1}{3}e^{-t}\sin \left ( 3t\right ) \right ) U\left ( t\right ) \]
Where \(U\left ( t\right ) \) is Heaviside function which is one for \(t>0\). Note that it seems one
should not give IC at same point of application of \(\delta \left ( t\right ) \) as in this problem. So this problem might
be ill posed. Need to look more into this.
4.3.1.3.5 Example 5
\begin{align*} y^{\prime \prime }+2y^{\prime }+y & =0\\ y^{\prime }\left ( 0\right ) & =2 \end{align*}
This problem shows what to do when one IC is missing. Basically, if an IC is missing, it is
just kept unknown. Taking Laplace transform gives
\begin{align*} \left ( s^{2}Y-sy\left ( 0\right ) -y^{\prime }\left ( 0\right ) \right ) +2\left ( sY-y\left ( 0\right ) \right ) +Y & =0\\ \left ( s^{2}Y-sy\left ( 0\right ) -2\right ) +\left ( 2sY-2y\left ( 0\right ) \right ) +Y & =0 \end{align*}
Since not all initial conditions are given, then we let the missing IC be some unknown. In
this case \(y\left ( 0\right ) =c_{1}\). And continue as before. The above becomes
\begin{align*} \left ( s^{2}Y-sc_{1}-2\right ) +\left ( 2sY-2c_{1}\right ) +Y & =0\\ Y\left ( s^{2}+2s+1\right ) -sc_{1}-2-2c_{1} & =0\\ Y & =\frac {sc_{1}+2+2c_{1}}{s^{2}+2s+1}\end{align*}
Applying inverse Laplace transform gives
\begin{equation} y\left ( t\right ) =\left ( c_{1}+2t+c_{1}t\right ) e^{-t} \tag {1}\end{equation}
We can if we want, now replace \(c_{1}=y\left ( 0\right ) \) to make it more
clear what the \(c_{1}\) represents.
\begin{equation} y\left ( t\right ) =\left ( y\left ( 0\right ) +2t+y\left ( 0\right ) t\right ) e^{-t} \tag {2}\end{equation}
4.3.1.3.6 Example 6
\begin{align*} y^{\prime \prime }+2y^{\prime }+y & =0\\ y\left ( 0\right ) & =0 \end{align*}
Taking Laplace transform gives
\begin{align*} \left ( s^{2}Y-sy\left ( 0\right ) -y^{\prime }\left ( 0\right ) \right ) +2\left ( sY-y\left ( 0\right ) \right ) +Y & =0\\ \left ( s^{2}Y-y^{\prime }\left ( 0\right ) \right ) +2sY+Y & =0 \end{align*}
Since one IC is missing, then let \(y^{\prime }\left ( 0\right ) =c_{2}\). The above becomes
\begin{align*} \left ( s^{2}Y-c_{2}\right ) +2sY+Y & =0\\ Y\left ( s^{2}+2s+1\right ) -c_{2} & =0\\ Y & =\frac {c_{2}}{s^{2}+2s+1}\end{align*}
Applying inverse Laplace transform gives
\begin{equation} y\left ( t\right ) =c_{2}te^{-t} \tag {1}\end{equation}
We can if we want, now replace \(c_{2}=y^{\prime }\left ( 0\right ) \) to make it more
clear what the \(c_{2}\) represents.
\begin{equation} y\left ( t\right ) =y^{\prime }\left ( 0\right ) te^{-t} \tag {2}\end{equation}
4.3.1.3.7 Example 7
This example is for higher order ode, showing how to easily handle IC if at zero or not or if
some missing or not, all using same process. Given
\begin{equation} y^{\prime \prime \prime }+y^{\prime \prime }+y^{\prime }+y=0 \tag {1}\end{equation}
And lets say the IC’s given are
\begin{align*} y\left ( 1\right ) & =a\\ y^{\prime \prime }\left ( 0\right ) & =b \end{align*}
The idea is to always use \(c_{0},c_{1},c_{2}\) for \(y\left ( 0\right ) ,y^{\prime }\left ( 0\right ) ,y^{\prime \prime }\left ( 0\right ) \) and then at the very end solve for these from the given initial
conditions. We will get two equations (since we only have 2 IC) and 3 unknowns. So some of
the \(c_{0},c_{1},c_{2}\) will remain in the solution as unknowns which is OK. Applying Laplace transform on
(1) gives
\[ s^{3}Y-y^{\prime \prime }\left ( 0\right ) -sy^{\prime }\left ( 0\right ) -s^{2}y\left ( 0\right ) +s^{2}Y-y^{\prime }\left ( 0\right ) -sy\left ( 0\right ) +sY-y\left ( 0\right ) +Y=0 \]
We now replace \(y^{\prime \prime }\left ( 0\right ) =c_{2},y^{\prime }\left ( 0\right ) =c_{1},y\left ( 0\right ) =c_{0}\) and simplify the above which becomes
\begin{align*} Y\left ( s^{3}+s^{2}+s+1\right ) -c_{2}-sc_{1}-s^{2}c_{0}-c_{1}-sc_{0}-c_{0} & =0\\ Y\left ( s^{3}+s^{2}+s+1\right ) -s^{2}c_{0}-s\left ( c_{1}+c_{0}\right ) -c_{2}-c_{1}-c_{0} & =0\\ Y & =\frac {c_{2}+c_{1}+c_{0}+s\left ( c_{1}+c_{0}\right ) +s^{2}c_{0}}{s^{3}+s^{2}+s+1}\end{align*}
Taking inverse Laplace gives the solution as
\begin{equation} y\left ( t\right ) =\frac {1}{2}\left ( c_{0}-c_{2}\right ) \cos \left ( t\right ) +\frac {1}{2}e^{-t}\left ( c_{0}+c_{2}\right ) +\frac {1}{2}\sin \left ( t\right ) \left ( c_{0}+2c_{1}+c_{2}\right ) \tag {2}\end{equation}
Now we only need to solve for the constants using the given initial conditions.
This results in these two equations (since we have 2 IC only). Using \(y\left ( 1\right ) =a\) gives
\begin{equation} a=\frac {1}{2}\left ( c_{0}-c_{2}\right ) \cos \left ( 1\right ) +\frac {1}{2}e^{-1}\left ( c_{0}+c_{2}\right ) +\frac {1}{2}\sin \left ( 1\right ) \left ( c_{0}+2c_{1}+c_{2}\right ) \tag {3}\end{equation}
Taking
derivatives twice of (2) and using \(y^{\prime \prime }\left ( 0\right ) =b\) gives the second equation
\[ y^{\prime \prime }\left ( t\right ) =\frac {1}{2}e^{-t}\left ( c_{0}+c_{2}\right ) +\frac {1}{2}\left ( -c_{0}-2c_{1}-c_{2}\right ) \sin \left ( t\right ) -\frac {1}{2}\left ( c_{0}-c_{2}\right ) \cos \left ( t\right ) \]
Using \(y^{\prime \prime }\left ( 0\right ) =b\) the above
gives
\begin{align} b & =\frac {1}{2}\left ( c_{0}+c_{2}\right ) -\frac {1}{2}\left ( c_{0}-c_{2}\right ) \nonumber \\ & =c_{2} \tag {4}\end{align}
Now we need to solve (3,4) for \(c_{0},c_{1},c_{2}\). From (4) we see that \(c_{2}=b\). Substituting this into (3) gives
\begin{equation} a=\frac {1}{2}\left ( c_{0}-b\right ) \cos \left ( 1\right ) +\frac {1}{2}e^{-1}\left ( c_{0}+b\right ) +\frac {1}{2}\sin \left ( 1\right ) \left ( c_{0}+2c_{1}+b\right ) \tag {5}\end{equation}
We
can now choose the free parameter as \(c_{0}\), hence
\[ c_{1}=-\frac {1}{2\sin \left ( 1\right ) }\left ( \cos \left ( 1\right ) +e^{-1}+\sin \left ( 1\right ) \right ) c_{0}+\frac {1}{2\sin \left ( 1\right ) }\left ( b\cos \left ( 1\right ) -be^{-1}-b\sin \left ( 1\right ) +2a\right ) \]
We are done. The solution (2) is now found by
replacing \(c_{2},c_{1}\) into it. \(c_{0}\) remains are the only unknown. This method works for any combination
of IC given even if some at zero or not.
4.3.1.3.8 Example 8 (non-constant coefficient)
\begin{equation} tx^{\prime \prime }\left ( t\right ) +x^{\prime }+tx=0 \tag {1}\end{equation}
Assuming \(x\left ( 0\right ) =1,x^{\prime }\left ( 0\right ) =0\). In solving ode using Laplace where the coefficient in time varying, we will be
using the relation
\begin{equation} L\left ( t^{n}f\left ( t\right ) \right ) =\left ( -1\right ) ^{n}F^{\left ( n\right ) }\left ( s\right ) \tag {2}\end{equation}
Where \(F\left ( s\right ) \) is the laplace transform of \(f\left ( t\right ) \). For example, if the input is \(tx\left ( t\right ) \) the
Laplace tranaform is \(-X^{\prime }\left ( s\right ) =-\frac {dX\left ( s\right ) }{ds}\) and if the input is \(t^{2}x\left ( t\right ) \) then the Laplace transform is \(\frac {d^{2}X\left ( s\right ) }{s^{2}}\) and so on.
This will generate an ODE in \(X\left ( s\right ) \) which we have to solve for \(X\left ( s\right ) \). Applying this to (1)
gives
\begin{align*} L\left ( x^{\prime \prime }\right ) & =s^{2}X\left ( s\right ) -sx\left ( 0\right ) -x^{\prime }\left ( 0\right ) \\ L\left ( x^{\prime }\right ) & =sX\left ( s\right ) -x\left ( 0\right ) \\ L\left ( x\right ) & =X\left ( s\right ) \end{align*}
Hence using (2) on the above, then Laplace transform of (1) becomes
\[ -\frac {d}{ds}\left ( s^{2}X\left ( s\right ) -sx\left ( 0\right ) -x^{\prime }\left ( 0\right ) \right ) +\left ( sX\left ( s\right ) -x\left ( 0\right ) \right ) -\frac {d}{ds}X\left ( s\right ) =0 \]
Substituting initial
conditions gives
\begin{align*} -\frac {d}{ds}\left ( s^{2}X\left ( s\right ) -s\right ) +\left ( sX\left ( s\right ) -1\right ) -\frac {d}{ds}X\left ( s\right ) & =0\\ -\left ( 2sX+s^{2}X^{\prime }-1\right ) +sX-1-X^{\prime }\left ( s\right ) & =0\\ X^{\prime }\left ( -s^{2}-1\right ) +X\left ( -2s+s\right ) & =0\\ \left ( s^{2}+1\right ) X^{\prime }+sX & =0 \end{align*}
This differential equation is now solved for \(X\left ( s\right ) \) which gives
\[ X\left ( s\right ) =\frac {c_{1}}{\sqrt {s^{2}+1}}\]
The inverse Laplace transform is
\[ x\left ( t\right ) =c_{1}\operatorname {BesselJ}_{0}\left ( t\right ) \]
Since \(x\left ( 0\right ) =1\) then
\[ 1=c_{1}\operatorname {BesselJ}_{0}\left ( 0\right ) \]
But \(\operatorname {BesselJ}_{0}\left ( 0\right ) =1\), hence \(c_{1}=1\) and the solution is
\[ x\left ( t\right ) =\operatorname {BesselJ}_{0}\left ( t\right ) \]