2.3.4.2 second order linear constant coeff
\[\begin {aligned} x^{\prime \prime }-x^{\prime }+x&=\sin \left (2 t \right )\\ x \left (0\right ) &= 0\\ x^{\prime }\left (0\right ) &= 1\\ \end {aligned}\]
Entering second order linear constant coefficient ode solverThis is second order non-homogeneous
ODE. In standard form the ODE is
\[ A x''(t) + B x'(t) + C x(t) = f(t) \]
Where \(A=1, B=-1, C=1, f(t)=\sin \left (2 t \right )\). Let the solution be
\[ x = x_h + x_p \]
Where \(x_h\) is the solution to the homogeneous ODE
\begin{align*} A x''(t) + B x'(t) + C x(t) &= 0 \end{align*}
And \(x_p\) is a particular solution to the non-homogeneous ODE
\begin{align*} A x''(t) + B x'(t) + C x(t) &= f(t) \end{align*}
Where \(x_h\) is the solution to
\begin{align*} x^{\prime \prime }-x^{\prime }+x = 0 \end{align*}
This is second order with constant coefficients homogeneous ODE. In standard form the ODE is
\[ A x''(t) + B x'(t) + C x(t) = 0 \]
Where in the above \(A=1, B=-1, C=1\). Let the solution be \(x=e^{\lambda t}\). Substituting this into the ODE gives
\[ \lambda ^{2} {\mathrm e}^{\lambda t}-\lambda \,{\mathrm e}^{\lambda t}+{\mathrm e}^{\lambda t} = 0 \tag {1} \]
Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda t}\) gives
\[ \lambda ^{2}-\lambda +1 = 0 \tag {2} \]
Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution
form. Using the quadratic formula the roots are
\[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \]
Substituting \(A=1, B=-1, C=1\) into the above gives
\begin{align*} \lambda _{1,2} &= \frac {1}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {-1^2 - (4) \left (1\right )\left (1\right )}\\ &= {\frac {1}{2}} \pm \frac {i \sqrt {3}}{2} \end{align*}
Hence
\begin{align*} \lambda _1 &= {\frac {1}{2}} + \frac {i \sqrt {3}}{2}\\ \lambda _2 &= {\frac {1}{2}} - \frac {i \sqrt {3}}{2} \end{align*}
Which simplifies to
\begin{gather*} \begin {aligned} \lambda _1 &= \frac {1}{2}+\frac {i \sqrt {3}}{2}\\ \lambda _2 &= \frac {1}{2}-\frac {i \sqrt {3}}{2} \end {aligned} \end{gather*}
Since the roots are complex conjugate of each others, then let the roots be
\begin{align*} \lambda _{1,2} &= \alpha \pm i \beta \end{align*}
Where \(\alpha ={\frac {1}{2}}\) and \(\beta =\frac {\sqrt {3}}{2}\). Therefore the final solution using Euler relation can be written as
\begin{align*} x &= e^{\alpha t} \left ( c_1 \cos (\beta t) + c_2 \sin (\beta t) \right ) \end{align*}
Which becomes
\begin{align*} x &= e^{\frac {t}{2}}\left (c_1 \cos \left (\frac {\sqrt {3}\, t}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, t}{2}\right )\right ) \end{align*}
Therefore the homogeneous solution \(x_h\) is
\begin{align*} x_h &= {\mathrm e}^{\frac {t}{2}} \left (c_1 \cos \left (\frac {\sqrt {3}\, t}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, t}{2}\right )\right ) \end{align*}
The particular solution is found using the method of undetermined coefficients. Looking at the
RHS of the ode, which is
\[ \sin \left (2 t \right ) \]
Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial
solution is
\[ [\{\cos \left (2 t \right ), \sin \left (2 t \right )\}] \]
While the set of the basis functions for the homogeneous solution found earlier is
\[ \left \{{\mathrm e}^{\frac {t}{2}} \cos \left (\frac {\sqrt {3}\, t}{2}\right ), {\mathrm e}^{\frac {t}{2}} \sin \left (\frac {\sqrt {3}\, t}{2}\right )\right \} \]
Since there is no duplication between the basis function in the UC_set and the basis functions of
the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.
\begin{align*} x_p &= A_{1} \cos \left (2 t \right )+A_{2} \sin \left (2 t \right ) \end{align*}
The unknowns \(\{A_{1}, A_{2}\}\) are found by substituting the above trial solution \(x_p\) into the ODE and
comparing coefficients. Substituting the trial solution into the ODE and simplifying gives
\begin{align*} -3 A_{1} \cos \left (2 t \right )-3 A_{2} \sin \left (2 t \right )+2 A_{1} \sin \left (2 t \right )-2 A_{2} \cos \left (2 t \right ) = \sin \left (2 t \right ) \end{align*}
Solving for the unknowns by comparing coefficients results in
\[ \left [A_{1} = {\frac {2}{13}}, A_{2} = -{\frac {3}{13}}\right ] \]
Substituting the above back in the above trial solution \(x_p\), gives the particular solution
\begin{align*} x_p &= \frac {2 \cos \left (2 t \right )}{13}-\frac {3 \sin \left (2 t \right )}{13} \end{align*}
Therefore the general solution is
\begin{gather*} \begin {aligned} x &= x_h + x_p \\ &= \left ({\mathrm e}^{\frac {t}{2}} \left (c_1 \cos \left (\frac {\sqrt {3}\, t}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, t}{2}\right )\right )\right ) + \left (\frac {2 \cos \left (2 t \right )}{13}-\frac {3 \sin \left (2 t \right )}{13}\right ) \end {aligned} \end{gather*}
Applying the initial conditions \([x \left (0\right ) = 0, x^{\prime }\left (0\right ) = 1]\), the solution becomes
\begin{align*}
x &= -\frac {2 \,{\mathrm e}^{\frac {t}{2}} \cos \left (\frac {\sqrt {3}\, t}{2}\right )}{13}+\frac {40 \sin \left (\frac {\sqrt {3}\, t}{2}\right ) {\mathrm e}^{\frac {t}{2}} \sqrt {3}}{39}+\frac {2 \cos \left (2 t \right )}{13}-\frac {3 \sin \left (2 t \right )}{13} \\
\end{align*}
|
|
|
| \(x = -\frac {2 \,{\mathrm e}^{\frac {t}{2}} \cos \left (\frac {\sqrt {3}\, t}{2}\right )}{13}+\frac {40 \sin \left (\frac {\sqrt {3}\, t}{2}\right ) {\mathrm e}^{\frac {t}{2}} \sqrt {3}}{39}+\frac {2 \cos \left (2 t \right )}{13}-\frac {3 \sin \left (2 t \right )}{13}\) | Direction field |