\(\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{align*}
((-B \amp + 2C)\cos x + (-2A + D)\sin x - Ax\cos x - Cx\sin x) \\
\amp - 10((A + D)\cos x + (-B + C)\sin x + Cx\cos x - Ax\sin x) = x \sin x
\end{align*}
\begin{align*}
\amp (-B + 2C - 10A - 10D)\cos x \\
\amp +\ (-2A + D + 10B - 10C)\sin x \\
\amp +\ (-A + C)\ x\cos x + {\DLO (-C - A)}\ x\sin x = {\DLO 1} x \sin x
\end{align*}
\begin{align*}
-B + 2C - 10A - 10D \amp = 0 \\
-2A + D + 10B - 10C \amp = 0
\end{align*}
\begin{align*}
-A + C \amp = 0 \\
{\DLO -C - A} \amp = {\DLO 1}
\end{align*}
\begin{gather*}
\Rightarrow
\end{gather*}
\begin{align*}
A \amp = \sfrac12 \\
C \amp = \sfrac12
\end{align*}
Substituting
\(A = \sfrac12\) and
\(C = \sfrac12\) into the first two equations gives:
\begin{align*}
-B - 10D \amp = 4 \\
10B + D \amp = 6
\end{align*}
\begin{gather*}
\Rightarrow
\end{gather*}
\begin{align*}
-10B - 100D \amp = 40 \\
10B + D \amp = 6
\end{align*}
\begin{gather*}
\Rightarrow
\end{gather*}
\begin{align*}
B \amp = \sfrac{64}{99} \\
D \amp = \sfrac{46}{99}
\end{align*}
\begin{equation*}
y_p = \left(\frac{1}{2} + \frac{64}{99}x\right) \cos x + \left(\frac{1}{2} + \frac{46}{99}x\right) \sin x
\end{equation*}
\begin{equation*}
y = c_1 \cos x + c_2 \sin x + \left(\frac{1}{2} + \frac{64}{99}x\right) \cos x + \left(\frac{1}{2} + \frac{46}{99}x\right) \sin x
\end{equation*}