\(\ds r^2 - 10r = 0, \ r(r - 10) = 0, \ r = 0, 10 \)
\(\ds y_h = c_1 + c_2 e^{10x} \)
\(\ds y_p = (A x + B) \cos x + (C x + D) \sin x \)
Note: This part can be a bit intense. The product rule is used multiple times, and after each step, we regroup the \(\cos x\text{,}\) \(\sin x\text{,}\) \(x\cos x\text{,}\) and \(x\sin x\) terms.
Compute
\(y_p'\) and
\(y_p''\text{:}\)
\begin{align*}
y_p' \amp = A \cos x - (Ax + B) \sin x + C \sin x + (Cx + D) \cos x \\
\amp = (A + D)\cos x + (-B + C)\sin x + Cx\cos x - Ax\sin x \\
y_p'' \amp = -(A + D)\sin x + (-B + C)\cos x \\
\amp \hspace{4cm} + C\cos x - Cx\sin x - A\sin x - Ax\cos x \\
\amp = (-B + 2C)\cos x + (-2A - D)\sin x - Ax\cos x - Cx\sin x
\end{align*}
Substitute
\(y_p''\text{,}\) \(y_p'\text{:}\)
\begin{alignat*}{5}
(-B + 2C) \amp {}\cos x{}
{}+{} \amp (-2A + D) \amp {}\sin x{}
{}+{} \amp (-A) \amp {}x\cos x{}
{}+{} \amp (-C) \amp {}x\sin x{}
\amp\\
-10((A + D) \amp {}\cos x{}
{}+{} \amp (-B + C) \amp {}\sin x{}
{}+{} \amp (C) \amp {}x\cos x{}
{}+{} \amp (-A) \amp {}x\sin x{})
\amp\\
\amp
\amp \amp
\amp \amp
\amp {}={} \amp x \sin x
\amp
\end{alignat*}
\begin{align*}
\amp (-B + 2C - 10A - 10D)\cos x + (10B - 2A - D - 10C)\sin x \\
\amp + (-A - 10C)\ x\cos x + {\DLO (10A - C)}\ x\sin x = {\DLO 1} x \sin x
\end{align*}
\begin{alignat*}{4}
-10{}A{}\amp {}-{}\amp {}B{}\amp {}+{}\amp 2{}C{}\amp {}-{}\amp 10 {}D{}\amp {}={} 0 \\
-2{}A{}\amp {}+{}\amp 10{}B{}\amp {}+{}\amp {}C{}\amp {}-{}\amp {}D{}\amp {}={} 0 \\
- {}A{}\amp {} {}\amp {} {}\amp {}-{}\amp 10{}C{}\amp {} {}\amp {} {}\amp {}={} 0 \\
10{}A{}\amp {} {}\amp {} {}\amp {}-{}\amp {}C{}\amp {} {} \amp {} {}\amp {}={} 1
\end{alignat*}
\begin{gather*}
\\
\\
\Rightarrow \\
\Rightarrow
\end{gather*}
\begin{align*}
\\
\\
A \amp = \sfrac{10}{101} \\
C \amp = -\sfrac{1}{101}
\end{align*}
Substituting
\(A\) and
\(C\) into the first two equations gives:
\begin{alignat*}{2}
- {}B{}\amp {}-{}\amp 10 {}D{}\amp {}={} \sfrac{102}{101} \\
10 {}B{}\amp {}-{}\amp {}D{}\amp {}={} \sfrac{10}{101}
\end{alignat*}
\begin{gather*}
\Rightarrow\\
\Rightarrow
\end{gather*}
\begin{alignat*}{2}
-10{}B{}\amp {}-{}\amp 100 {}D{}\amp {}={} \sfrac{1020}{101} \\
10{}B{}\amp {}-{}\amp {}D{}\amp {}={} \sfrac{10}{101}
\end{alignat*}
Adding the two equations gives:
\(B = -\sfrac{2}{10201}\) and
\(D = -\sfrac{1030}{10201}\)
\begin{equation*}
y_p = \left(\frac{10}{101}x - \frac{2}{10201}\right) \cos x + \left(-\frac{1}{101}x - \frac{1030}{10201}\right) \sin x
\end{equation*}
\begin{equation*}
y = c_1 + c_2 e^{10x} + \left(\frac{10}{101}x - \frac{2}{10201}\right) \cos x + \left(-\frac{1}{101}x - \frac{1030}{10201}\right) \sin x
\end{equation*}