Internal problem ID [2170]
Internal file name [OUTPUT/2170_Monday_February_26_2024_09_18_02_AM_24547031/index.tex
]
Book: Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath.
Boston. 1964
Section: Exercise 19, page 86
Problem number: 31.
ODE order: 2.
ODE degree: 1.
The type(s) of ODE detected by this program : "kovacic", "exact linear second order ode", "second_order_integrable_as_is", "second_order_ode_missing_y", "second_order_linear_constant_coeff"
Maple gives the following as the ode type
[[_2nd_order, _missing_y]]
\[ \boxed {2 y^{\prime \prime }+y^{\prime }=8 \sin \left (2 x \right )+{\mathrm e}^{-x}} \] With initial conditions \begin {align*} [y \left (0\right ) = 1, y^{\prime }\left (0\right ) = 0] \end {align*}
This is a linear ODE. In canonical form it is written as \begin {align*} y^{\prime \prime } + p(x)y^{\prime } + q(x) y &= F \end {align*}
Where here \begin {align*} p(x) &={\frac {1}{2}}\\ q(x) &=0\\ F &=4 \sin \left (2 x \right )+\frac {{\mathrm e}^{-x}}{2} \end {align*}
Hence the ode is \begin {align*} y^{\prime \prime }+\frac {y^{\prime }}{2} = 4 \sin \left (2 x \right )+\frac {{\mathrm e}^{-x}}{2} \end {align*}
The domain of \(p(x)={\frac {1}{2}}\) is \[
\{-\infty
This is second order non-homogeneous ODE. In standard form the ODE is \[ A y''(x) + B y'(x) + C y(x) = f(x) \] Where \(A=2, B=1, C=0, f(x)=8 \sin \left (2 x \right )+{\mathrm e}^{-x}\).
Let the solution be \[ y = y_h + y_p \] Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a
particular solution to the non-homogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to \[ 2 y^{\prime \prime }+y^{\prime } = 0 \] This is second
order with constant coefficients homogeneous ODE. In standard form the ODE is \[ A y''(x) + B y'(x) + C y(x) = 0 \]
Where in the above \(A=2, B=1, C=0\). Let the solution be \(y=e^{\lambda x}\). Substituting this into the ODE gives \[ 2 \lambda ^{2} {\mathrm e}^{\lambda x}+\lambda \,{\mathrm e}^{\lambda x} = 0 \tag {1} \]
Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda x}\) gives \[ 2 \lambda ^{2}+\lambda = 0 \tag {2} \]
Equation (2) is the characteristic equation of the ODE. Its roots determine the
general solution form.Using the quadratic formula \[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \] Substituting \(A=2, B=1, C=0\) into the above gives
\begin {align*} \lambda _{1,2} &= \frac {-1}{(2) \left (2\right )} \pm \frac {1}{(2) \left (2\right )} \sqrt {1^2 - (4) \left (2\right )\left (0\right )}\\ &= -{\frac {1}{4}} \pm {\frac {1}{4}} \end {align*}
Hence \begin{align*}
\lambda _1 &= -{\frac {1}{4}} + {\frac {1}{4}} \\
\lambda _2 &= -{\frac {1}{4}} - {\frac {1}{4}} \\
\end{align*} Which simplifies to \begin{align*}
\lambda _1 &= 0 \\
\lambda _2 &= -{\frac {1}{2}} \\
\end{align*} Since roots are real and distinct, then the solution is \begin{align*}
y &= c_{1} e^{\lambda _1 x} + c_{2} e^{\lambda _2 x} \\
y &= c_{1} e^{\left (0\right )x} +c_{2} e^{\left (-{\frac {1}{2}}\right )x} \\
\end{align*} Or \[
y =c_{1} +c_{2} {\mathrm e}^{-\frac {x}{2}}
\]
Therefore the homogeneous solution \(y_h\) is \[
y_h = c_{1} +c_{2} {\mathrm e}^{-\frac {x}{2}}
\] The particular solution is now found using the
method of undetermined coefficients. Looking at the RHS of the ode, which is \[ 8 \sin \left (2 x \right )+{\mathrm e}^{-x} \] Shows that
the corresponding undetermined set of the basis functions (UC_set) for the trial solution is \[ [\{{\mathrm e}^{-x}\}, \{\cos \left (2 x \right ), \sin \left (2 x \right )\}] \]
While the set of the basis functions for the homogeneous solution found earlier is \[ \left \{1, {\mathrm e}^{-\frac {x}{2}}\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. \[
y_p = A_{1} {\mathrm e}^{-x}+A_{2} \cos \left (2 x \right )+A_{3} \sin \left (2 x \right )
\] The unknowns \(\{A_{1}, A_{2}, A_{3}\}\) are found by substituting the above trial solution \(y_p\) into the ODE
and comparing coefficients. Substituting the trial solution into the ODE and simplifying
gives \[
A_{1} {\mathrm e}^{-x}-8 A_{2} \cos \left (2 x \right )-8 A_{3} \sin \left (2 x \right )-2 A_{2} \sin \left (2 x \right )+2 A_{3} \cos \left (2 x \right ) = 8 \sin \left (2 x \right )+{\mathrm e}^{-x}
\] Solving for the unknowns by comparing coefficients results in \[ \left [A_{1} = 1, A_{2} = -{\frac {4}{17}}, A_{3} = -{\frac {16}{17}}\right ] \] Substituting the
above back in the above trial solution \(y_p\), gives the particular solution \[
y_p = {\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17}
\] Therefore
the general solution is \begin{align*}
y &= y_h + y_p \\
&= \left (c_{1} +c_{2} {\mathrm e}^{-\frac {x}{2}}\right ) + \left ({\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17}\right ) \\
\end{align*} Initial conditions are used to solve for the constants of
integration.
Looking at the above solution \begin {align*} y = c_{1} +c_{2} {\mathrm e}^{-\frac {x}{2}}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \tag {1} \end {align*}
Initial conditions are now substituted in the above solution. This will generate the required
equations to solve for the integration constants. substituting \(y = 1\) and \(x = 0\) in the above gives
\begin {align*} 1 = c_{1} +c_{2} +\frac {13}{17}\tag {1A} \end {align*}
Taking derivative of the solution gives \begin {align*} y^{\prime } = -\frac {c_{2} {\mathrm e}^{-\frac {x}{2}}}{2}-{\mathrm e}^{-x}+\frac {8 \sin \left (2 x \right )}{17}-\frac {32 \cos \left (2 x \right )}{17} \end {align*}
substituting \(y^{\prime } = 0\) and \(x = 0\) in the above gives \begin {align*} 0 = -\frac {c_{2}}{2}-\frac {49}{17}\tag {2A} \end {align*}
Equations {1A,2A} are now solved for \(\{c_{1}, c_{2}\}\). Solving for the constants gives \begin {align*} c_{1}&=6\\ c_{2}&=-{\frac {98}{17}} \end {align*}
Substituting these values back in above solution results in \begin {align*} y = 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \end {align*}
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \\
\end{align*} Verification of solutions
\[
y = 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17}
\] Verified OK. Integrating both sides of the ODE w.r.t \(x\) gives \begin {align*} \int \left (2 y^{\prime \prime }+y^{\prime }\right )d x &= \int \left (8 \sin \left (2 x \right )+{\mathrm e}^{-x}\right )d x\\ 2 y^{\prime }+y = -4 \cos \left (2 x \right )-{\mathrm e}^{-x} + c_{1} \end {align*}
Which is now solved for \(y\).
Entering Linear first order ODE solver. In canonical form a linear first order is
\begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}
Where here \begin {align*} p(x) &={\frac {1}{2}}\\ q(x) &=-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2} \end {align*}
Hence the ode is \begin {align*} y^{\prime }+\frac {y}{2} = -2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2} \end {align*}
The integrating factor \(\mu \) is \begin{align*}
\mu &= {\mathrm e}^{\int \frac {1}{2}d x} \\
&= {\mathrm e}^{\frac {x}{2}} \\
\end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left ({\mathrm e}^{\frac {x}{2}} y\right ) &= \left ({\mathrm e}^{\frac {x}{2}}\right ) \left (-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2}\right )\\ \mathrm {d} \left ({\mathrm e}^{\frac {x}{2}} y\right ) &= \left (\frac {\left (-4 \,{\mathrm e}^{x} \cos \left (2 x \right )+c_{1} {\mathrm e}^{x}-1\right ) {\mathrm e}^{-\frac {x}{2}}}{2}\right )\, \mathrm {d} x \end {align*}
Integrating gives \begin {align*} {\mathrm e}^{\frac {x}{2}} y &= \int {\frac {\left (-4 \,{\mathrm e}^{x} \cos \left (2 x \right )+c_{1} {\mathrm e}^{x}-1\right ) {\mathrm e}^{-\frac {x}{2}}}{2}\,\mathrm {d} x}\\ {\mathrm e}^{\frac {x}{2}} y &= {\mathrm e}^{-\frac {x}{2}}+c_{1} {\mathrm e}^{\frac {x}{2}}-\frac {4 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}-\frac {16 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17} + c_{2} \end {align*}
Dividing both sides by the integrating factor \(\mu ={\mathrm e}^{\frac {x}{2}}\) results in \begin {align*} y &= {\mathrm e}^{-\frac {x}{2}} \left ({\mathrm e}^{-\frac {x}{2}}+c_{1} {\mathrm e}^{\frac {x}{2}}-\frac {4 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}-\frac {16 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17}\right )+c_{2} {\mathrm e}^{-\frac {x}{2}} \end {align*}
which simplifies to \begin {align*} y &= -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \end {align*}
Initial conditions are used to solve for the constants of integration.
Looking at the above solution \begin {align*} y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \tag {1} \end {align*}
Initial conditions are now substituted in the above solution. This will generate the required
equations to solve for the integration constants. substituting \(y = 1\) and \(x = 0\) in the above gives
\begin {align*} 1 = c_{1} +c_{2} +\frac {13}{17}\tag {1A} \end {align*}
Taking derivative of the solution gives \begin {align*} y^{\prime } = -\frac {\left (8 \,{\mathrm e}^{x} \sin \left (2 x \right )+36 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-\frac {17 c_{2} {\mathrm e}^{\frac {x}{2}}}{2}\right ) {\mathrm e}^{-x}}{17}+\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \end {align*}
substituting \(y^{\prime } = 0\) and \(x = 0\) in the above gives \begin {align*} 0 = -\frac {c_{2}}{2}-\frac {49}{17}\tag {2A} \end {align*}
Equations {1A,2A} are now solved for \(\{c_{1}, c_{2}\}\). Solving for the constants gives \begin {align*} c_{1}&=6\\ c_{2}&=-{\frac {98}{17}} \end {align*}
Substituting these values back in above solution results in \begin {align*} y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17} \end {align*}
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17} \\
\end{align*} Verification of solutions
\[
y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17}
\] Verified OK. This is second order ode with missing dependent variable \(y\). Let \begin {align*} p(x) &= y^{\prime } \end {align*}
Then \begin {align*} p'(x) &= y^{\prime \prime } \end {align*}
Hence the ode becomes \begin {align*} 2 p^{\prime }\left (x \right )+p \left (x \right )-8 \sin \left (2 x \right )-{\mathrm e}^{-x} = 0 \end {align*}
Which is now solve for \(p(x)\) as first order ode.
Entering Linear first order ODE solver. The integrating factor \(\mu \) is \begin{align*}
\mu &= {\mathrm e}^{\int \frac {1}{2}d x} \\
&= {\mathrm e}^{\frac {x}{2}} \\
\end{align*} The ode becomes
\begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu p\right ) &= \left (\mu \right ) \left (4 \sin \left (2 x \right )+\frac {{\mathrm e}^{-x}}{2}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left ({\mathrm e}^{\frac {x}{2}} p\right ) &= \left ({\mathrm e}^{\frac {x}{2}}\right ) \left (4 \sin \left (2 x \right )+\frac {{\mathrm e}^{-x}}{2}\right )\\ \mathrm {d} \left ({\mathrm e}^{\frac {x}{2}} p\right ) &= \left (4 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )+\frac {{\mathrm e}^{-\frac {x}{2}}}{2}\right )\, \mathrm {d} x \end {align*}
Integrating gives \begin {align*} {\mathrm e}^{\frac {x}{2}} p &= \int {4 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )+\frac {{\mathrm e}^{-\frac {x}{2}}}{2}\,\mathrm {d} x}\\ {\mathrm e}^{\frac {x}{2}} p &= -\frac {32 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}+\frac {8 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17}-{\mathrm e}^{-\frac {x}{2}} + c_{1} \end {align*}
Dividing both sides by the integrating factor \(\mu ={\mathrm e}^{\frac {x}{2}}\) results in \begin {align*} p \left (x \right ) &= {\mathrm e}^{-\frac {x}{2}} \left (-\frac {32 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}+\frac {8 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17}-{\mathrm e}^{-\frac {x}{2}}\right )+c_{1} {\mathrm e}^{-\frac {x}{2}} \end {align*}
which simplifies to \begin {align*} p \left (x \right ) &= \frac {\left (8 \,{\mathrm e}^{x} \sin \left (2 x \right )-32 \,{\mathrm e}^{x} \cos \left (2 x \right )+17 c_{1} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \end {align*}
Initial conditions are used to solve for \(c_{1}\). Substituting \(x=0\) and \(p=0\) in the above solution gives an
equation to solve for the constant of integration. \begin {align*} 0 = -\frac {49}{17}+c_{1} \end {align*}
The solutions are \begin {align*} c_{1} = {\frac {49}{17}} \end {align*}
Trying the constant \begin {align*} c_{1} = {\frac {49}{17}} \end {align*}
Substituting this in the general solution gives \begin {align*} p \left (x \right )&=\frac {{\mathrm e}^{-x} \left (8 \,{\mathrm e}^{x} \sin \left (2 x \right )-32 \,{\mathrm e}^{x} \cos \left (2 x \right )+49 \,{\mathrm e}^{\frac {x}{2}}-17\right )}{17} \end {align*}
The constant \(c_{1} = {\frac {49}{17}}\) gives valid solution.
Since \(p=y^{\prime }\) then the new first order ode to solve is \begin {align*} y^{\prime } = \frac {{\mathrm e}^{-x} \left (8 \,{\mathrm e}^{x} \sin \left (2 x \right )-32 \,{\mathrm e}^{x} \cos \left (2 x \right )+49 \,{\mathrm e}^{\frac {x}{2}}-17\right )}{17} \end {align*}
Integrating both sides gives \begin {align*} y &= \int { \frac {{\mathrm e}^{-x} \left (8 \,{\mathrm e}^{x} \sin \left (2 x \right )-32 \,{\mathrm e}^{x} \cos \left (2 x \right )+49 \,{\mathrm e}^{\frac {x}{2}}-17\right )}{17}\,\mathop {\mathrm {d}x}}\\ &= {\mathrm e}^{-x}-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}-\frac {32 \sin \left (x \right ) \cos \left (x \right )}{17}-\frac {8 \cos \left (x \right )^{2}}{17}+c_{2} \end {align*}
Initial conditions are used to solve for \(c_{2}\). Substituting \(x=0\) and \(y=1\) in the above solution gives an
equation to solve for the constant of integration. \begin {align*} 1 = -\frac {89}{17}+c_{2} \end {align*}
The solutions are \begin {align*} c_{2} = {\frac {106}{17}} \end {align*}
Trying the constant \begin {align*} c_{2} = {\frac {106}{17}} \end {align*}
Substituting this in the general solution gives \begin {align*} y&=6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \end {align*}
The constant \(c_{2} = {\frac {106}{17}}\) gives valid solution.
Initial conditions are used to solve for the constants of integration.
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \\
\end{align*} Verification of solutions
\[
y = 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17}
\] Verified OK. Writing the ode as \[
2 y^{\prime \prime }+y^{\prime } = 8 \sin \left (2 x \right )+{\mathrm e}^{-x}
\] Integrating both sides of the ODE w.r.t \(x\) gives \begin {align*} \int \left (2 y^{\prime \prime }+y^{\prime }\right )d x &= \int \left (8 \sin \left (2 x \right )+{\mathrm e}^{-x}\right )d x\\ 2 y^{\prime }+y = -4 \cos \left (2 x \right )-{\mathrm e}^{-x} +c_{1} \end {align*}
Which is now solved for \(y\).
Entering Linear first order ODE solver. In canonical form a linear first order is
\begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}
Where here \begin {align*} p(x) &={\frac {1}{2}}\\ q(x) &=-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2} \end {align*}
Hence the ode is \begin {align*} y^{\prime }+\frac {y}{2} = -2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2} \end {align*}
The integrating factor \(\mu \) is \begin{align*}
\mu &= {\mathrm e}^{\int \frac {1}{2}d x} \\
&= {\mathrm e}^{\frac {x}{2}} \\
\end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left ({\mathrm e}^{\frac {x}{2}} y\right ) &= \left ({\mathrm e}^{\frac {x}{2}}\right ) \left (-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2}\right )\\ \mathrm {d} \left ({\mathrm e}^{\frac {x}{2}} y\right ) &= \left (\frac {\left (-4 \,{\mathrm e}^{x} \cos \left (2 x \right )+c_{1} {\mathrm e}^{x}-1\right ) {\mathrm e}^{-\frac {x}{2}}}{2}\right )\, \mathrm {d} x \end {align*}
Integrating gives \begin {align*} {\mathrm e}^{\frac {x}{2}} y &= \int {\frac {\left (-4 \,{\mathrm e}^{x} \cos \left (2 x \right )+c_{1} {\mathrm e}^{x}-1\right ) {\mathrm e}^{-\frac {x}{2}}}{2}\,\mathrm {d} x}\\ {\mathrm e}^{\frac {x}{2}} y &= {\mathrm e}^{-\frac {x}{2}}+c_{1} {\mathrm e}^{\frac {x}{2}}-\frac {4 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}-\frac {16 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17} + c_{2} \end {align*}
Dividing both sides by the integrating factor \(\mu ={\mathrm e}^{\frac {x}{2}}\) results in \begin {align*} y &= {\mathrm e}^{-\frac {x}{2}} \left ({\mathrm e}^{-\frac {x}{2}}+c_{1} {\mathrm e}^{\frac {x}{2}}-\frac {4 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}-\frac {16 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17}\right )+c_{2} {\mathrm e}^{-\frac {x}{2}} \end {align*}
which simplifies to \begin {align*} y &= -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \end {align*}
Initial conditions are used to solve for the constants of integration.
Looking at the above solution \begin {align*} y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \tag {1} \end {align*}
Initial conditions are now substituted in the above solution. This will generate the required
equations to solve for the integration constants. substituting \(y = 1\) and \(x = 0\) in the above gives
\begin {align*} 1 = c_{1} +c_{2} +\frac {13}{17}\tag {1A} \end {align*}
Taking derivative of the solution gives \begin {align*} y^{\prime } = -\frac {\left (8 \,{\mathrm e}^{x} \sin \left (2 x \right )+36 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-\frac {17 c_{2} {\mathrm e}^{\frac {x}{2}}}{2}\right ) {\mathrm e}^{-x}}{17}+\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \end {align*}
substituting \(y^{\prime } = 0\) and \(x = 0\) in the above gives \begin {align*} 0 = -\frac {c_{2}}{2}-\frac {49}{17}\tag {2A} \end {align*}
Equations {1A,2A} are now solved for \(\{c_{1}, c_{2}\}\). Solving for the constants gives \begin {align*} c_{1}&=6\\ c_{2}&=-{\frac {98}{17}} \end {align*}
Substituting these values back in above solution results in \begin {align*} y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17} \end {align*}
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17} \\
\end{align*} Verification of solutions
\[
y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17}
\] Verified OK. Writing the ode as \begin {align*} 2 y^{\prime \prime }+y^{\prime } &= 0 \tag {1} \\ A y^{\prime \prime } + B y^{\prime } + C y &= 0 \tag {2} \end {align*}
Comparing (1) and (2) shows that \begin {align*} A &= 2 \\ B &= 1\tag {3} \\ C &= 0 \end {align*}
Applying the Liouville transformation on the dependent variable gives \begin {align*} z(x) &= y e^{\int \frac {B}{2 A} \,dx} \end {align*}
Then (2) becomes \begin {align*} z''(x) = r z(x)\tag {4} \end {align*}
Where \(r\) is given by \begin {align*} r &= \frac {s}{t}\tag {5} \\ &= \frac {2 A B' - 2 B A' + B^2 - 4 A C}{4 A^2} \end {align*}
Substituting the values of \(A,B,C\) from (3) in the above and simplifying gives \begin {align*} r &= \frac {1}{16}\tag {6} \end {align*}
Comparing the above to (5) shows that \begin {align*} s &= 1\\ t &= 16 \end {align*}
Therefore eq. (4) becomes \begin {align*} z''(x) &= \frac {z \left (x \right )}{16} \tag {7} \end {align*}
Equation (7) is now solved. After finding \(z(x)\) then \(y\) is found using the inverse transformation
\begin {align*} y &= z \left (x \right ) e^{-\int \frac {B}{2 A} \,dx} \end {align*}
The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3
cases depending on the order of poles of \(r\) and the order of \(r\) at \(\infty \). The following table
summarizes these cases. Case Allowed pole order for \(r\) Allowed value for \(\mathcal {O}(\infty )\) 1 \(\left \{ 0,1,2,4,6,8,\cdots \right \} \) \(\left \{ \cdots ,-6,-4,-2,0,2,3,4,5,6,\cdots \right \} \) 2
Need to have at least one pole
that is either order \(2\) or odd order
greater than \(2\). Any other pole order
is allowed as long as the above
condition is satisfied. Hence the
following set of pole orders are all
allowed. \(\{1,2\}\),\(\{1,3\}\),\(\{2\}\),\(\{3\}\),\(\{3,4\}\),\(\{1,2,5\}\). no condition 3 \(\left \{ 1,2\right \} \) \(\left \{ 2,3,4,5,6,7,\cdots \right \} \) The order of \(r\) at \(\infty \) is the degree of \(t\) minus the degree of \(s\). Therefore \begin {align*} O\left (\infty \right ) &= \text {deg}(t) - \text {deg}(s) \\ &= 0 - 0 \\ &= 0 \end {align*}
There are no poles in \(r\). Therefore the set of poles \(\Gamma \) is empty. Since there is no odd order pole
larger than \(2\) and the order at \(\infty \) is \(0\) then the necessary conditions for case one are met.
Therefore \begin {align*} L &= [1] \end {align*}
Since \(r = {\frac {1}{16}}\) is not a function of \(x\), then there is no need run Kovacic algorithm to obtain a solution
for transformed ode \(z''=r z\) as one solution is \[ z_1(x) = {\mathrm e}^{-\frac {x}{4}} \] Using the above, the solution for the original ode can
now be found. The first solution to the original ode in \(y\) is found from \begin{align*}
y_1 &= z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dx} \\
&= z_1 e^{ -\int \frac {1}{2} \frac {1}{2} \,dx} \\
&= z_1 e^{-\frac {x}{4}} \\
&= z_1 \left ({\mathrm e}^{-\frac {x}{4}}\right ) \\
\end{align*} Which simplifies to \[
y_1 = {\mathrm e}^{-\frac {x}{2}}
\]
The second solution \(y_2\) to the original ode is found using reduction of order \[ y_2 = y_1 \int \frac { e^{\int -\frac {B}{A} \,dx}}{y_1^2} \,dx \] Substituting gives \begin{align*}
y_2 &= y_1 \int \frac { e^{\int -\frac {1}{2} \,dx}}{\left (y_1\right )^2} \,dx \\
&= y_1 \int \frac { e^{-\frac {x}{2}}}{\left (y_1\right )^2} \,dx \\
&= y_1 \left (2 \,{\mathrm e}^{\frac {x}{2}}\right ) \\
\end{align*}
Therefore the solution is
\begin{align*}
y &= c_{1} y_1 + c_{2} y_2 \\
&= c_{1} \left ({\mathrm e}^{-\frac {x}{2}}\right ) + c_{2} \left ({\mathrm e}^{-\frac {x}{2}}\left (2 \,{\mathrm e}^{\frac {x}{2}}\right )\right ) \\
\end{align*} This is second order nonhomogeneous ODE. Let the solution be \[
y = y_h + y_p
\] Where \(y_h\) is the solution to
the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the nonhomogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the
solution to \[
2 y^{\prime \prime }+y^{\prime } = 0
\] The homogeneous solution is found using the Kovacic algorithm which results in \[
y_h = c_{1} {\mathrm e}^{-\frac {x}{2}}+2 c_{2}
\]
The particular solution is now found using the method of undetermined coefficients. Looking
at the RHS of the ode, which is \[ 8 \sin \left (2 x \right )+{\mathrm e}^{-x} \] Shows that the corresponding undetermined set of the basis
functions (UC_set) for the trial solution is \[ [\{{\mathrm e}^{-x}\}, \{\cos \left (2 x \right ), \sin \left (2 x \right )\}] \] While the set of the basis functions for the
homogeneous solution found earlier is \[ \left \{2, {\mathrm e}^{-\frac {x}{2}}\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. \[
y_p = A_{1} {\mathrm e}^{-x}+A_{2} \cos \left (2 x \right )+A_{3} \sin \left (2 x \right )
\] The unknowns \(\{A_{1}, A_{2}, A_{3}\}\)
are found by substituting the above trial solution \(y_p\) into the ODE and comparing
coefficients. Substituting the trial solution into the ODE and simplifying gives \[
A_{1} {\mathrm e}^{-x}-8 A_{2} \cos \left (2 x \right )-8 A_{3} \sin \left (2 x \right )-2 A_{2} \sin \left (2 x \right )+2 A_{3} \cos \left (2 x \right ) = 8 \sin \left (2 x \right )+{\mathrm e}^{-x}
\]
Solving for the unknowns by comparing coefficients results in \[ \left [A_{1} = 1, A_{2} = -{\frac {4}{17}}, A_{3} = -{\frac {16}{17}}\right ] \] Substituting the
above back in the above trial solution \(y_p\), gives the particular solution \[
y_p = {\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17}
\] Therefore
the general solution is \begin{align*}
y &= y_h + y_p \\
&= \left (c_{1} {\mathrm e}^{-\frac {x}{2}}+2 c_{2}\right ) + \left ({\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17}\right ) \\
\end{align*} Initial conditions are used to solve for the constants of
integration.
Looking at the above solution \begin {align*} y = c_{1} {\mathrm e}^{-\frac {x}{2}}+2 c_{2} +{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \tag {1} \end {align*}
Initial conditions are now substituted in the above solution. This will generate the required
equations to solve for the integration constants. substituting \(y = 1\) and \(x = 0\) in the above gives
\begin {align*} 1 = c_{1} +2 c_{2} +\frac {13}{17}\tag {1A} \end {align*}
Taking derivative of the solution gives \begin {align*} y^{\prime } = -\frac {c_{1} {\mathrm e}^{-\frac {x}{2}}}{2}-{\mathrm e}^{-x}+\frac {8 \sin \left (2 x \right )}{17}-\frac {32 \cos \left (2 x \right )}{17} \end {align*}
substituting \(y^{\prime } = 0\) and \(x = 0\) in the above gives \begin {align*} 0 = -\frac {c_{1}}{2}-\frac {49}{17}\tag {2A} \end {align*}
Equations {1A,2A} are now solved for \(\{c_{1}, c_{2}\}\). Solving for the constants gives \begin {align*} c_{1}&=-{\frac {98}{17}}\\ c_{2}&=3 \end {align*}
Substituting these values back in above solution results in \begin {align*} y = 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \end {align*}
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \\
\end{align*} Verification of solutions
\[
y = 6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17}
\] Verified OK. An ode of the form \begin {align*} p \left (x \right ) y^{\prime \prime }+q \left (x \right ) y^{\prime }+r \left (x \right ) y&=s \left (x \right ) \end {align*}
is exact if \begin {align*} p''(x) - q'(x) + r(x) &= 0 \tag {1} \end {align*}
For the given ode we have \begin {align*} p(x) &= 2\\ q(x) &= 1\\ r(x) &= 0\\ s(x) &= 8 \sin \left (2 x \right )+{\mathrm e}^{-x} \end {align*}
Hence \begin {align*} p''(x) &= 0\\ q'(x) &= 0 \end {align*}
Therefore (1) becomes \begin {align*} 0- \left (0\right ) + \left (0\right )&=0 \end {align*}
Hence the ode is exact. Since we now know the ode is exact, it can be written as
\begin {align*} \left (p \left (x \right ) y^{\prime }+\left (q \left (x \right )-p^{\prime }\left (x \right )\right ) y\right )' &= s(x) \end {align*}
Integrating gives \begin {align*} p \left (x \right ) y^{\prime }+\left (q \left (x \right )-p^{\prime }\left (x \right )\right ) y&=\int {s \left (x \right )\, dx} \end {align*}
Substituting the above values for \(p,q,r,s\) gives \begin {align*} 2 y^{\prime }+y&=\int {8 \sin \left (2 x \right )+{\mathrm e}^{-x}\, dx} \end {align*}
We now have a first order ode to solve which is \begin {align*} 2 y^{\prime }+y = -4 \cos \left (2 x \right )-{\mathrm e}^{-x}+c_{1} \end {align*}
Entering Linear first order ODE solver. In canonical form a linear first order is
\begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}
Where here \begin {align*} p(x) &={\frac {1}{2}}\\ q(x) &=-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2} \end {align*}
Hence the ode is \begin {align*} y^{\prime }+\frac {y}{2} = -2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2} \end {align*}
The integrating factor \(\mu \) is \begin{align*}
\mu &= {\mathrm e}^{\int \frac {1}{2}d x} \\
&= {\mathrm e}^{\frac {x}{2}} \\
\end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left ({\mathrm e}^{\frac {x}{2}} y\right ) &= \left ({\mathrm e}^{\frac {x}{2}}\right ) \left (-2 \cos \left (2 x \right )-\frac {{\mathrm e}^{-x}}{2}+\frac {c_{1}}{2}\right )\\ \mathrm {d} \left ({\mathrm e}^{\frac {x}{2}} y\right ) &= \left (\frac {\left (-4 \,{\mathrm e}^{x} \cos \left (2 x \right )+c_{1} {\mathrm e}^{x}-1\right ) {\mathrm e}^{-\frac {x}{2}}}{2}\right )\, \mathrm {d} x \end {align*}
Integrating gives \begin {align*} {\mathrm e}^{\frac {x}{2}} y &= \int {\frac {\left (-4 \,{\mathrm e}^{x} \cos \left (2 x \right )+c_{1} {\mathrm e}^{x}-1\right ) {\mathrm e}^{-\frac {x}{2}}}{2}\,\mathrm {d} x}\\ {\mathrm e}^{\frac {x}{2}} y &= {\mathrm e}^{-\frac {x}{2}}+c_{1} {\mathrm e}^{\frac {x}{2}}-\frac {4 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}-\frac {16 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17} + c_{2} \end {align*}
Dividing both sides by the integrating factor \(\mu ={\mathrm e}^{\frac {x}{2}}\) results in \begin {align*} y &= {\mathrm e}^{-\frac {x}{2}} \left ({\mathrm e}^{-\frac {x}{2}}+c_{1} {\mathrm e}^{\frac {x}{2}}-\frac {4 \,{\mathrm e}^{\frac {x}{2}} \cos \left (2 x \right )}{17}-\frac {16 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )}{17}\right )+c_{2} {\mathrm e}^{-\frac {x}{2}} \end {align*}
which simplifies to \begin {align*} y &= -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \end {align*}
Initial conditions are used to solve for the constants of integration.
Looking at the above solution \begin {align*} y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \tag {1} \end {align*}
Initial conditions are now substituted in the above solution. This will generate the required
equations to solve for the integration constants. substituting \(y = 1\) and \(x = 0\) in the above gives
\begin {align*} 1 = c_{1} +c_{2} +\frac {13}{17}\tag {1A} \end {align*}
Taking derivative of the solution gives \begin {align*} y^{\prime } = -\frac {\left (8 \,{\mathrm e}^{x} \sin \left (2 x \right )+36 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-\frac {17 c_{2} {\mathrm e}^{\frac {x}{2}}}{2}\right ) {\mathrm e}^{-x}}{17}+\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17 c_{1} {\mathrm e}^{x}-17 c_{2} {\mathrm e}^{\frac {x}{2}}-17\right ) {\mathrm e}^{-x}}{17} \end {align*}
substituting \(y^{\prime } = 0\) and \(x = 0\) in the above gives \begin {align*} 0 = -\frac {c_{2}}{2}-\frac {49}{17}\tag {2A} \end {align*}
Equations {1A,2A} are now solved for \(\{c_{1}, c_{2}\}\). Solving for the constants gives \begin {align*} c_{1}&=6\\ c_{2}&=-{\frac {98}{17}} \end {align*}
Substituting these values back in above solution results in \begin {align*} y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17} \end {align*}
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17} \\
\end{align*} Verification of solutions
\[
y = -\frac {\left (16 \,{\mathrm e}^{x} \sin \left (2 x \right )+4 \,{\mathrm e}^{x} \cos \left (2 x \right )-17-102 \,{\mathrm e}^{x}+98 \,{\mathrm e}^{\frac {x}{2}}\right ) {\mathrm e}^{-x}}{17}
\] Verified OK. \[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [2 y^{\prime \prime }+y^{\prime }=8 \sin \left (2 x \right )+{\mathrm e}^{-x}, y \left (0\right )=1, y^{\prime }{\raise{-0.36em}{\Big |}}{\mstack {}{_{\left \{x \hiderel {=}0\right \}}}}=0\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & y^{\prime \prime } \\ \bullet & {} & \textrm {Isolate 2nd derivative}\hspace {3pt} \\ {} & {} & y^{\prime \prime }=-\frac {y^{\prime }}{2}+4 \sin \left (2 x \right )+\frac {{\mathrm e}^{-x}}{2} \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE; ODE is linear}\hspace {3pt} \\ {} & {} & y^{\prime \prime }+\frac {y^{\prime }}{2}=4 \sin \left (2 x \right )+\frac {{\mathrm e}^{-x}}{2} \\ \bullet & {} & \textrm {Characteristic polynomial of homogeneous ODE}\hspace {3pt} \\ {} & {} & r^{2}+\frac {1}{2} r =0 \\ \bullet & {} & \textrm {Factor the characteristic polynomial}\hspace {3pt} \\ {} & {} & \frac {r \left (2 r +1\right )}{2}=0 \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (0, -\frac {1}{2}\right ) \\ \bullet & {} & \textrm {1st solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{1}\left (x \right )=1 \\ \bullet & {} & \textrm {2nd solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{2}\left (x \right )={\mathrm e}^{-\frac {x}{2}} \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & y=c_{1} y_{1}\left (x \right )+c_{2} y_{2}\left (x \right )+y_{p}\left (x \right ) \\ \bullet & {} & \textrm {Substitute in solutions of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y=c_{1} +c_{2} {\mathrm e}^{-\frac {x}{2}}+y_{p}\left (x \right ) \\ \square & {} & \textrm {Find a particular solution}\hspace {3pt} y_{p}\left (x \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 (x \right )\hspace {3pt}\textrm {is the forcing function}\hspace {3pt} \\ {} & {} & \left [y_{p}\left (x \right )=-y_{1}\left (x \right ) \left (\int \frac {y_{2}\left (x \right ) f \left (x \right )}{W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )}d x \right )+y_{2}\left (x \right ) \left (\int \frac {y_{1}\left (x \right ) f \left (x \right )}{W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )}d x \right ), f \left (x \right )=4 \sin \left (2 x \right )+\frac {{\mathrm e}^{-x}}{2}\right ] \\ {} & \circ & \textrm {Wronskian of solutions of the homogeneous equation}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )=\left [\begin {array}{cc} 1 & {\mathrm e}^{-\frac {x}{2}} \\ 0 & -\frac {{\mathrm e}^{-\frac {x}{2}}}{2} \end {array}\right ] \\ {} & \circ & \textrm {Compute Wronskian}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )=-\frac {{\mathrm e}^{-\frac {x}{2}}}{2} \\ {} & \circ & \textrm {Substitute functions into equation for}\hspace {3pt} y_{p}\left (x \right ) \\ {} & {} & y_{p}\left (x \right )=-\left (\int \left (-8 \sin \left (2 x \right )-{\mathrm e}^{-x}\right )d x \right )+{\mathrm e}^{-\frac {x}{2}} \left (\int \left (-8 \,{\mathrm e}^{\frac {x}{2}} \sin \left (2 x \right )-{\mathrm e}^{-\frac {x}{2}}\right )d x \right ) \\ {} & \circ & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & y_{p}\left (x \right )={\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \\ \bullet & {} & \textrm {Substitute particular solution into general solution to ODE}\hspace {3pt} \\ {} & {} & y=c_{1} +c_{2} {\mathrm e}^{-\frac {x}{2}}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \\ \square & {} & \textrm {Check validity of solution}\hspace {3pt} y=c_{1} +c_{2} {\mathrm e}^{-\frac {x}{2}}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \\ {} & \circ & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=1 \\ {} & {} & 1=c_{1} +c_{2} +\frac {13}{17} \\ {} & \circ & \textrm {Compute derivative of the solution}\hspace {3pt} \\ {} & {} & y^{\prime }=-\frac {c_{2} {\mathrm e}^{-\frac {x}{2}}}{2}-{\mathrm e}^{-x}+\frac {8 \sin \left (2 x \right )}{17}-\frac {32 \cos \left (2 x \right )}{17} \\ {} & \circ & \textrm {Use the initial condition}\hspace {3pt} y^{\prime }{\raise{-0.36em}{\Big |}}{\mstack {}{_{\left \{x \hiderel {=}0\right \}}}}=0 \\ {} & {} & 0=-\frac {c_{2}}{2}-\frac {49}{17} \\ {} & \circ & \textrm {Solve for}\hspace {3pt} c_{1} \hspace {3pt}\textrm {and}\hspace {3pt} c_{2} \\ {} & {} & \left \{c_{1} =6, c_{2} =-\frac {98}{17}\right \} \\ {} & \circ & \textrm {Substitute constant values into general solution and simplify}\hspace {3pt} \\ {} & {} & y=6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y=6-\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}-\frac {16 \sin \left (2 x \right )}{17} \end {array} \]
Maple trace
✓ Solution by Maple
Time used: 0.016 (sec). Leaf size: 28
\[
y \left (x \right ) = -\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}-\frac {16 \sin \left (2 x \right )}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}+6
\]
✓ Solution by Mathematica
Time used: 0.384 (sec). Leaf size: 39
\[
y(x)\to e^{-x}-\frac {98 e^{-x/2}}{17}-\frac {16}{17} \sin (2 x)-\frac {4}{17} \cos (2 x)+6
\]
11.31.2 Solving as second order linear constant coeff ode
11.31.3 Solving as second order integrable as is ode
11.31.4 Solving as second order ode missing y ode
11.31.5 Solving as type second_order_integrable_as_is (not using ABC version)
11.31.6 Solving using Kovacic algorithm
11.31.7 Solving as exact linear second order ode ode
11.31.8 Maple step by step solution
`Methods for second order ODEs:
--- Trying classification methods ---
trying a quadrature
trying high order exact linear fully integrable
-> Calling odsolve with the ODE`, diff(_b(_a), _a) = -(1/2)*_b(_a)+4*sin(2*_a)+(1/2)*exp(-_a), _b(_a)` *** Sublevel 2 ***
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
<- 1st order linear successful
<- high order exact linear fully integrable successful`
dsolve([2*diff(y(x),x$2)+diff(y(x),x)=8*sin(2*x)+exp(-x),y(0) = 1, D(y)(0) = 0],y(x), singsol=all)
DSolve[{2*y''[x]+y'[x]==8*Sin[2*x]+Exp[-x],{y[0]==1,y'[0]==0}},y[x],x,IncludeSingularSolutions -> True]