2.5.16 problem 16
Internal
problem
ID
[8653]
Book
:
Own
collection
of
miscellaneous
problems
Section
:
section
5.0
Problem
number
:
16
Date
solved
:
Thursday, December 12, 2024 at 09:37:45 AM
CAS
classification
:
[[_2nd_order, _linear, _nonhomogeneous]]
Solve
\begin{align*} y^{\prime \prime }+2 y^{\prime }-24 y&=16-\left (x +2\right ) {\mathrm e}^{4 x} \end{align*}
Solved as second order linear constant coeff ode
Time used: 0.158 (sec)
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=1, B=2, C=-24, f(x)=16+\left (-x -2\right ) {\mathrm e}^{4 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
\[ y^{\prime \prime }+2 y^{\prime }-24 y = 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=1, B=2, C=-24\) . Let the solution be \(y=e^{\lambda x}\) . Substituting this into the ODE gives
\[ \lambda ^{2} {\mathrm e}^{x \lambda }+2 \lambda \,{\mathrm e}^{x \lambda }-24 \,{\mathrm e}^{x \lambda } = 0 \tag {1} \]
Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda x}\) gives
\[ \lambda ^{2}+2 \lambda -24 = 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=1, B=2, C=-24\) into the above gives
\begin{align*} \lambda _{1,2} &= \frac {-2}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {2^2 - (4) \left (1\right )\left (-24\right )}\\ &= -1 \pm 5 \end{align*}
Hence
\begin{align*}
\lambda _1 &= -1 + 5 \\
\lambda _2 &= -1 - 5 \\
\end{align*}
Which simplifies to
\begin{align*}
\lambda _1 &= 4 \\
\lambda _2 &= -6 \\
\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 (4\right )x} +c_2 e^{\left (-6\right )x} \\
\end{align*}
Or
\[
y =c_1 \,{\mathrm e}^{4 x}+c_2 \,{\mathrm e}^{-6 x}
\]
Therefore the homogeneous solution \(y_h\) is
\[
y_h = c_1 \,{\mathrm e}^{4 x}+c_2 \,{\mathrm e}^{-6 x}
\]
The particular solution is now found using the
method of undetermined coefficients. Looking at the RHS of the ode, which is
\[ 16+\left (-x -2\right ) {\mathrm e}^{4 x} \]
Shows
that the corresponding undetermined set of the basis functions (UC_set) for the
trial solution is
\[ [\{1\}, \{{\mathrm e}^{4 x} x, {\mathrm e}^{4 x}\}] \]
While the set of the basis functions for the homogeneous solution
found earlier is
\[ \{{\mathrm e}^{-6 x}, {\mathrm e}^{4 x}\} \]
Since \({\mathrm e}^{4 x}\) is duplicated in the UC_set, then this basis is multiplied
by extra \(x\) . The UC_set becomes
\[ [\{1\}, \{x^{2} {\mathrm e}^{4 x}, {\mathrm e}^{4 x} x\}] \]
Since there was duplication between the basis
functions in the UC_set and the basis functions of the homogeneous solution, the trial
solution is a linear combination of all the basis function in the above updated
UC_set.
\[
y_p = A_{1}+A_{2} x^{2} {\mathrm e}^{4 x}+A_{3} {\mathrm e}^{4 x} x
\]
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
\[
2 A_{2} {\mathrm e}^{4 x}+20 A_{2} x \,{\mathrm e}^{4 x}+10 A_{3} {\mathrm e}^{4 x}-24 A_{1} = 16-\left (x +2\right ) {\mathrm e}^{4 x}
\]
Solving for the unknowns by comparing coefficients results
in
\[ \left [A_{1} = -{\frac {2}{3}}, A_{2} = -{\frac {1}{20}}, A_{3} = -{\frac {19}{100}}\right ] \]
Substituting the above back in the above trial solution \(y_p\) , gives the particular
solution
\[
y_p = -\frac {2}{3}-\frac {x^{2} {\mathrm e}^{4 x}}{20}-\frac {19 \,{\mathrm e}^{4 x} x}{100}
\]
Therefore the general solution is
\begin{align*}
y &= y_h + y_p \\
&= \left (c_1 \,{\mathrm e}^{4 x}+c_2 \,{\mathrm e}^{-6 x}\right ) + \left (-\frac {2}{3}-\frac {x^{2} {\mathrm e}^{4 x}}{20}-\frac {19 \,{\mathrm e}^{4 x} x}{100}\right ) \\
\end{align*}
Will add steps showing solving for IC
soon.
Summary of solutions found
\begin{align*}
y &= -\frac {2}{3}-\frac {x^{2} {\mathrm e}^{4 x}}{20}-\frac {19 \,{\mathrm e}^{4 x} x}{100}+c_1 \,{\mathrm e}^{4 x}+c_2 \,{\mathrm e}^{-6 x} \\
\end{align*}
Figure 2.225: Slope field plot
\(y^{\prime \prime }+2 y^{\prime }-24 y = 16-\left (x +2\right ) {\mathrm e}^{4 x}\)
Solved as second order ode using Kovacic algorithm
Time used: 0.270 (sec)
Writing the ode as
\begin{align*} y^{\prime \prime }+2 y^{\prime }-24 y &= 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 &= 1 \\ B &= 2\tag {3} \\ C &= -24 \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 {25}{1}\tag {6} \end{align*}
Comparing the above to (5) shows that
\begin{align*} s &= 25\\ t &= 1 \end{align*}
Therefore eq. (4) becomes
\begin{align*} z''(x) &= 25 z \left (x \right ) \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 \} \)
Table 2.123: Necessary conditions for each Kovacic case
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 = 25\) 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}^{-5 x} \]
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 {2}{1} \,dx} \\
&= z_1 e^{-x} \\
&= z_1 \left ({\mathrm e}^{-x}\right ) \\
\end{align*}
Which simplifies to
\[
y_1 = {\mathrm e}^{-6 x}
\]
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 {2}{1} \,dx}}{\left (y_1\right )^2} \,dx \\
&= y_1 \int \frac { e^{-2 x}}{\left (y_1\right )^2} \,dx \\
&= y_1 \left (\frac {{\mathrm e}^{-2 x} {\mathrm e}^{12 x}}{10}\right ) \\
\end{align*}
Therefore the solution is
\begin{align*}
y &= c_1 y_1 + c_2 y_2 \\
&= c_1 \left ({\mathrm e}^{-6 x}\right ) + c_2 \left ({\mathrm e}^{-6 x}\left (\frac {{\mathrm e}^{-2 x} {\mathrm e}^{12 x}}{10}\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
\[
y^{\prime \prime }+2 y^{\prime }-24 y = 0
\]
The homogeneous solution is found using the Kovacic algorithm which results in
\[
y_h = c_1 \,{\mathrm e}^{-6 x}+\frac {c_2 \,{\mathrm e}^{4 x}}{10}
\]
The particular solution \(y_p\) can be found using either the method of undetermined coefficients,
or the method of variation of parameters. The method of variation of parameters will be
used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as
well. Let
\begin{equation}
\tag{1} y_p(x) = u_1 y_1 + u_2 y_2
\end{equation}
Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly
independent solutions of the homogeneous ODE) found earlier when solving the
homogeneous ODE as
\begin{align*}
y_1 &= {\mathrm e}^{-6 x} \\
y_2 &= \frac {{\mathrm e}^{4 x}}{10} \\
\end{align*}
In the Variation of parameters \(u_1,u_2\) are found using
\begin{align*}
\tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\
\tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\
\end{align*}
Where \(W(x)\) is the
Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given
by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \) . Hence
\[ W = \begin {vmatrix} {\mathrm e}^{-6 x} & \frac {{\mathrm e}^{4 x}}{10} \\ \frac {d}{dx}\left ({\mathrm e}^{-6 x}\right ) & \frac {d}{dx}\left (\frac {{\mathrm e}^{4 x}}{10}\right ) \end {vmatrix} \]
Which gives
\[ W = \begin {vmatrix} {\mathrm e}^{-6 x} & \frac {{\mathrm e}^{4 x}}{10} \\ -6 \,{\mathrm e}^{-6 x} & \frac {2 \,{\mathrm e}^{4 x}}{5} \end {vmatrix} \]
Therefore
\[
W = \left ({\mathrm e}^{-6 x}\right )\left (\frac {2 \,{\mathrm e}^{4 x}}{5}\right ) - \left (\frac {{\mathrm e}^{4 x}}{10}\right )\left (-6 \,{\mathrm e}^{-6 x}\right )
\]
Which simplifies to
\[
W = {\mathrm e}^{-6 x} {\mathrm e}^{4 x}
\]
Which simplifies to
\[
W = {\mathrm e}^{-2 x}
\]
Therefore Eq. (2) becomes
\[
u_1 = -\int \frac {\frac {{\mathrm e}^{4 x} \left (16+\left (-x -2\right ) {\mathrm e}^{4 x}\right )}{10}}{{\mathrm e}^{-2 x}}\,dx
\]
Which simplifies to
\[
u_1 = - \int -\frac {\left (-16+\left (x +2\right ) {\mathrm e}^{4 x}\right ) {\mathrm e}^{6 x}}{10}d x
\]
Hence
\[
u_1 = \frac {{\mathrm e}^{10 x} x}{100}+\frac {19 \,{\mathrm e}^{10 x}}{1000}-\frac {4 \,{\mathrm e}^{6 x}}{15}
\]
And Eq. (3) becomes
\[
u_2 = \int \frac {{\mathrm e}^{-6 x} \left (16+\left (-x -2\right ) {\mathrm e}^{4 x}\right )}{{\mathrm e}^{-2 x}}\,dx
\]
Which
simplifies to
\[
u_2 = \int \left (16 \,{\mathrm e}^{-4 x}-x -2\right )d x
\]
Hence
\[
u_2 = -2 x -\frac {x^{2}}{2}-4 \,{\mathrm e}^{-4 x}
\]
Therefore the particular solution, from equation (1) is
\[
y_p(x) = \left (\frac {{\mathrm e}^{10 x} x}{100}+\frac {19 \,{\mathrm e}^{10 x}}{1000}-\frac {4 \,{\mathrm e}^{6 x}}{15}\right ) {\mathrm e}^{-6 x}+\frac {{\mathrm e}^{4 x} \left (-2 x -\frac {x^{2}}{2}-4 \,{\mathrm e}^{-4 x}\right )}{10}
\]
Which
simplifies to
\[
y_p(x) = -\frac {2}{3}+\frac {\left (-50 x^{2}-190 x +19\right ) {\mathrm e}^{4 x}}{1000}
\]
Therefore the general solution is
\begin{align*}
y &= y_h + y_p \\
&= \left (c_1 \,{\mathrm e}^{-6 x}+\frac {c_2 \,{\mathrm e}^{4 x}}{10}\right ) + \left (-\frac {2}{3}+\frac {\left (-50 x^{2}-190 x +19\right ) {\mathrm e}^{4 x}}{1000}\right ) \\
\end{align*}
Will add steps showing solving for IC
soon.
Summary of solutions found
\begin{align*}
y &= c_1 \,{\mathrm e}^{-6 x}+\frac {c_2 \,{\mathrm e}^{4 x}}{10}-\frac {2}{3}+\frac {\left (-50 x^{2}-190 x +19\right ) {\mathrm e}^{4 x}}{1000} \\
\end{align*}
Figure 2.226: Slope field plot
\(y^{\prime \prime }+2 y^{\prime }-24 y = 16-\left (x +2\right ) {\mathrm e}^{4 x}\)
Solved as second order ode adjoint method
Time used: 1.054 (sec)
In normal form the ode
\begin{align*} y^{\prime \prime }+2 y^{\prime }-24 y = 16-\left (x +2\right ) {\mathrm e}^{4 x} \tag {1} \end{align*}
Becomes
\begin{align*} y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y&=r \left (x \right ) \tag {2} \end{align*}
Where
\begin{align*} p \left (x \right )&=2\\ q \left (x \right )&=-24\\ r \left (x \right )&=16+\left (-x -2\right ) {\mathrm e}^{4 x} \end{align*}
The Lagrange adjoint ode is given by
\begin{align*} \xi ^{''}-(\xi \, p)'+\xi q &= 0\\ \xi ^{''}-\left (2 \xi \left (x \right )\right )' + \left (-24 \xi \left (x \right )\right ) &= 0\\ \xi ^{\prime \prime }\left (x \right )-2 \xi ^{\prime }\left (x \right )-24 \xi \left (x \right )&= 0 \end{align*}
Which is solved for \(\xi (x)\) . This is second order with constant coefficients homogeneous ODE. In
standard form the ODE is
\[ A \xi ''(x) + B \xi '(x) + C \xi (x) = 0 \]
Where in the above \(A=1, B=-2, C=-24\) . Let the solution be \(\xi =e^{\lambda x}\) . Substituting this into
the ODE gives
\[ \lambda ^{2} {\mathrm e}^{x \lambda }-2 \lambda \,{\mathrm e}^{x \lambda }-24 \,{\mathrm e}^{x \lambda } = 0 \tag {1} \]
Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda x}\)
gives
\[ \lambda ^{2}-2 \lambda -24 = 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=1, B=-2, C=-24\) into the above gives
\begin{align*} \lambda _{1,2} &= \frac {2}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {-2^2 - (4) \left (1\right )\left (-24\right )}\\ &= 1 \pm 5 \end{align*}
Hence
\begin{align*}
\lambda _1 &= 1 + 5 \\
\lambda _2 &= 1 - 5 \\
\end{align*}
Which simplifies to
\begin{align*}
\lambda _1 &= 6 \\
\lambda _2 &= -4 \\
\end{align*}
Since roots are real and distinct, then the solution is
\begin{align*}
\xi &= c_1 e^{\lambda _1 x} + c_2 e^{\lambda _2 x} \\
\xi &= c_1 e^{\left (6\right )x} +c_2 e^{\left (-4\right )x} \\
\end{align*}
Or
\[
\xi =c_1 \,{\mathrm e}^{6 x}+c_2 \,{\mathrm e}^{-4 x}
\]
Will
add steps showing solving for IC soon.
The original ode now reduces to first order ode
\begin{align*} \xi \left (x \right ) y^{\prime }-y \xi ^{\prime }\left (x \right )+\xi \left (x \right ) p \left (x \right ) y&=\int \xi \left (x \right ) r \left (x \right )d x\\ y^{\prime }+y \left (p \left (x \right )-\frac {\xi ^{\prime }\left (x \right )}{\xi \left (x \right )}\right )&=\frac {\int \xi \left (x \right ) r \left (x \right )d x}{\xi \left (x \right )} \end{align*}
Or
\begin{align*} y^{\prime }+y \left (2-\frac {6 c_1 \,{\mathrm e}^{6 x}-4 c_2 \,{\mathrm e}^{-4 x}}{c_1 \,{\mathrm e}^{6 x}+c_2 \,{\mathrm e}^{-4 x}}\right )&=\frac {-2 c_2 x +\frac {8 c_1 \,{\mathrm e}^{6 x}}{3}-\frac {c_1 \,{\mathrm e}^{10 x}}{5}-\frac {c_2 \,x^{2}}{2}-4 c_2 \,{\mathrm e}^{-4 x}-c_1 \left (\frac {{\mathrm e}^{10 x} x}{10}-\frac {{\mathrm e}^{10 x}}{100}\right )}{c_1 \,{\mathrm e}^{6 x}+c_2 \,{\mathrm e}^{-4 x}} \end{align*}
Which is now a first order ode. This is now solved for \(y\) . In canonical form a linear first order
is
\begin{align*} y^{\prime } + q(x)y &= p(x) \end{align*}
Comparing the above to the given ode shows that
\begin{align*} q(x) &=-\frac {4 c_1 \,{\mathrm e}^{10 x}-6 c_2}{c_1 \,{\mathrm e}^{10 x}+c_2}\\ p(x) &=\frac {800 c_1 \,{\mathrm e}^{10 x}+\left (-30 x -57\right ) c_1 \,{\mathrm e}^{14 x}-150 \left (8+\left (x^{2}+4 x \right ) {\mathrm e}^{4 x}\right ) c_2}{300 c_1 \,{\mathrm e}^{10 x}+300 c_2} \end{align*}
The integrating factor \(\mu \) is
\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {4 c_1 \,{\mathrm e}^{10 x}-6 c_2}{c_1 \,{\mathrm e}^{10 x}+c_2}d x}\\ &= \frac {\left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{c_1 \,{\mathrm e}^{10 x}+c_2} \end{align*}
The ode becomes
\begin{align*}
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \mu p \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (\frac {800 c_1 \,{\mathrm e}^{10 x}+\left (-30 x -57\right ) c_1 \,{\mathrm e}^{14 x}-150 \left (8+\left (x^{2}+4 x \right ) {\mathrm e}^{4 x}\right ) c_2}{300 c_1 \,{\mathrm e}^{10 x}+300 c_2}\right ) \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\frac {y \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{c_1 \,{\mathrm e}^{10 x}+c_2}\right ) &= \left (\frac {\left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{c_1 \,{\mathrm e}^{10 x}+c_2}\right ) \left (\frac {800 c_1 \,{\mathrm e}^{10 x}+\left (-30 x -57\right ) c_1 \,{\mathrm e}^{14 x}-150 \left (8+\left (x^{2}+4 x \right ) {\mathrm e}^{4 x}\right ) c_2}{300 c_1 \,{\mathrm e}^{10 x}+300 c_2}\right ) \\
\mathrm {d} \left (\frac {y \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{c_1 \,{\mathrm e}^{10 x}+c_2}\right ) &= \left (\frac {\left (800 c_1 \,{\mathrm e}^{10 x}+\left (-30 x -57\right ) c_1 \,{\mathrm e}^{14 x}-150 \left (8+\left (x^{2}+4 x \right ) {\mathrm e}^{4 x}\right ) c_2 \right ) \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{\left (300 c_1 \,{\mathrm e}^{10 x}+300 c_2 \right ) \left (c_1 \,{\mathrm e}^{10 x}+c_2 \right )}\right )\, \mathrm {d} x \\
\end{align*}
Integrating gives
\begin{align*} \frac {y \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{c_1 \,{\mathrm e}^{10 x}+c_2}&= \int {\frac {\left (800 c_1 \,{\mathrm e}^{10 x}+\left (-30 x -57\right ) c_1 \,{\mathrm e}^{14 x}-150 \left (8+\left (x^{2}+4 x \right ) {\mathrm e}^{4 x}\right ) c_2 \right ) \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{\left (300 c_1 \,{\mathrm e}^{10 x}+300 c_2 \right ) \left (c_1 \,{\mathrm e}^{10 x}+c_2 \right )} \,dx} \\ &=-\frac {\left ({\mathrm e}^{10 x}\right )^{{3}/{5}} {\mathrm e}^{-6 x} \left (15 x^{2}+57 x \right )}{300 c_1}+\frac {\left ({\mathrm e}^{10 x}\right )^{{3}/{5}} {\mathrm e}^{-6 x} \left (-2000 c_1 \,{\mathrm e}^{6 x}+150 c_2 \,x^{2}+570 c_2 x -57 c_2 \right )}{3000 \left (c_1 \,{\mathrm e}^{10 x}+c_2 \right ) c_1} + c_3 \end{align*}
Dividing throughout by the integrating factor \(\frac {\left ({\mathrm e}^{10 x}\right )^{{3}/{5}}}{c_1 \,{\mathrm e}^{10 x}+c_2}\) gives the final solution
\[ y = -\frac {\left (\left (\frac {40 c_1 \,{\mathrm e}^{6 x}}{3}+\frac {19 c_2}{50}\right ) \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}+\left (\left (x^{2}+\frac {19}{5} x \right ) \left ({\mathrm e}^{10 x}\right )^{{8}/{5}}-20 c_3 \left (c_1 \,{\mathrm e}^{16 x}+c_2 \,{\mathrm e}^{6 x}\right )\right ) c_1 \right ) {\mathrm e}^{-6 x}}{20 \left ({\mathrm e}^{10 x}\right )^{{3}/{5}} c_1} \]
Hence, the solution
found using Lagrange adjoint equation method is
\begin{align*}
y &= -\frac {\left (\left (\frac {40 c_1 \,{\mathrm e}^{6 x}}{3}+\frac {19 c_2}{50}\right ) \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}+\left (\left (x^{2}+\frac {19}{5} x \right ) \left ({\mathrm e}^{10 x}\right )^{{8}/{5}}-20 c_3 \left (c_1 \,{\mathrm e}^{16 x}+c_2 \,{\mathrm e}^{6 x}\right )\right ) c_1 \right ) {\mathrm e}^{-6 x}}{20 \left ({\mathrm e}^{10 x}\right )^{{3}/{5}} c_1} \\
\end{align*}
The constants can be merged to give
\[
y = -\frac {\left (\left (\frac {40 c_1 \,{\mathrm e}^{6 x}}{3}+\frac {19 c_2}{50}\right ) \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}+\left (\left (x^{2}+\frac {19}{5} x \right ) \left ({\mathrm e}^{10 x}\right )^{{8}/{5}}-20 c_1 \,{\mathrm e}^{16 x}-20 c_2 \,{\mathrm e}^{6 x}\right ) c_1 \right ) {\mathrm e}^{-6 x}}{20 \left ({\mathrm e}^{10 x}\right )^{{3}/{5}} c_1}
\]
Will
add steps showing solving for IC soon.
Summary of solutions found
\begin{align*}
y &= -\frac {\left (\left (\frac {40 c_1 \,{\mathrm e}^{6 x}}{3}+\frac {19 c_2}{50}\right ) \left ({\mathrm e}^{10 x}\right )^{{3}/{5}}+\left (\left (x^{2}+\frac {19}{5} x \right ) \left ({\mathrm e}^{10 x}\right )^{{8}/{5}}-20 c_1 \,{\mathrm e}^{16 x}-20 c_2 \,{\mathrm e}^{6 x}\right ) c_1 \right ) {\mathrm e}^{-6 x}}{20 \left ({\mathrm e}^{10 x}\right )^{{3}/{5}} c_1} \\
\end{align*}
Figure 2.227: Slope field plot
\(y^{\prime \prime }+2 y^{\prime }-24 y = 16-\left (x +2\right ) {\mathrm e}^{4 x}\)
Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )+2 \frac {d}{d x}y \left (x \right )-24 y \left (x \right )=16-\left (x +2\right ) {\mathrm e}^{4 x} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right ) \\ \bullet & {} & \textrm {Isolate 2nd derivative}\hspace {3pt} \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )=24 y \left (x \right )-{\mathrm e}^{4 x} x -2 \,{\mathrm e}^{4 x}-2 \frac {d}{d x}y \left (x \right )+16 \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y \left (x \right )\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE; ODE is linear}\hspace {3pt} \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )+2 \frac {d}{d x}y \left (x \right )-24 y \left (x \right )=-{\mathrm e}^{4 x} x -2 \,{\mathrm e}^{4 x}+16 \\ \bullet & {} & \textrm {Characteristic polynomial of homogeneous ODE}\hspace {3pt} \\ {} & {} & r^{2}+2 r -24=0 \\ \bullet & {} & \textrm {Factor the characteristic polynomial}\hspace {3pt} \\ {} & {} & \left (r +6\right ) \left (r -4\right )=0 \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (-6, 4\right ) \\ \bullet & {} & \textrm {1st solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{1}\left (x \right )={\mathrm e}^{-6 x} \\ \bullet & {} & \textrm {2nd solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{2}\left (x \right )={\mathrm e}^{4 x} \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} y_{1}\left (x \right )+\mathit {C2} y_{2}\left (x \right )+y_{p}\left (x \right ) \\ \bullet & {} & \textrm {Substitute in solutions of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} \,{\mathrm e}^{-6 x}+\mathit {C2} \,{\mathrm e}^{4 x}+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 )=-{\mathrm e}^{4 x} x -2 \,{\mathrm e}^{4 x}+16\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} {\mathrm e}^{-6 x} & {\mathrm e}^{4 x} \\ -6 \,{\mathrm e}^{-6 x} & 4 \,{\mathrm e}^{4 x} \end {array}\right ] \\ {} & \circ & \textrm {Compute Wronskian}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )=10 \,{\mathrm e}^{-2 x} \\ {} & \circ & \textrm {Substitute functions into equation for}\hspace {3pt} y_{p}\left (x \right ) \\ {} & {} & y_{p}\left (x \right )=\frac {\left ({\mathrm e}^{10 x} \left (\int \left (-x -2+16 \,{\mathrm e}^{-4 x}\right )d x \right )+\int \left (-16+\left (x +2\right ) {\mathrm e}^{4 x}\right ) {\mathrm e}^{6 x}d x \right ) {\mathrm e}^{-6 x}}{10} \\ {} & \circ & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & y_{p}\left (x \right )=-\frac {2}{3}+\frac {\left (-50 x^{2}-190 x +19\right ) {\mathrm e}^{4 x}}{1000} \\ \bullet & {} & \textrm {Substitute particular solution into general solution to ODE}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} \,{\mathrm e}^{-6 x}+\mathit {C2} \,{\mathrm e}^{4 x}-\frac {2}{3}+\frac {\left (-50 x^{2}-190 x +19\right ) {\mathrm e}^{4 x}}{1000} \end {array} \]
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 `
Maple dsolve solution
Solving time : 0.008
(sec)
Leaf size : 36
dsolve ( diff ( diff ( y ( x ), x ), x )+2* diff ( y ( x ), x )-24* y ( x ) = 16-(x+2)* exp (4* x ),
y(x),singsol=all)
\[
y = -\frac {\left (\left (x^{2}+\frac {19}{5} x -20 c_{1} -\frac {19}{50}\right ) {\mathrm e}^{10 x}-20 c_{2} +\frac {40 \,{\mathrm e}^{6 x}}{3}\right ) {\mathrm e}^{-6 x}}{20}
\]
Mathematica DSolve solution
Solving time : 0.222
(sec)
Leaf size : 41
DSolve [{ D [ y [ x ],{ x ,2}]+2* D [ y [ x ], x ]-24* y [ x ]==16-( x +2)* Exp [4* x ],{}},
y[x],x,IncludeSingularSolutions-> True ]
\[
y(x)\to e^{4 x} \left (-\frac {x^2}{20}-\frac {19 x}{100}+\frac {19}{1000}+c_2\right )+c_1 e^{-6 x}-\frac {2}{3}
\]