Say I have this equation:
$$y'' - 4y' + 4y = x - \sin{x}$$
My process is to: - find complementary solution - find the particular solution in two parts - add them together to find general solution.
Is this process and answer correct?
complementary solution find auxiliary: $$r^2 - 4r + 4 = 0$$ $$(r-2)(r-2) = 0$$
so complementary is: $y_c = c_1e^{2x} + c_2xe^{2x}$
part 1 of particular:
$$y_p1 = y'' - 4y' + 4y = x$$
the particular is in the form: $Ax + B$ $$y'p = A$$ $$y''p = 0$$ so via substitution:
$$- 4A + 4Ax + 4B = x$$
setting coefficients equal:
$-4A = 1$ and $A = \frac{1}{4}$ and $B = \frac{1}{4}$
so this part of this particular solution is $$y_p1 = \frac{1}{4}x + \frac{1}{4}$$
the other part of the particular is this:
$$y_p2 = A\sin{x} + B\cos{x}$$ $$y'_p2 = A\cos{x} - B\sin{x}$$ $$y''_p2 = -A\sin{x} - B\cos{x}$$
so substituting into $y'' - 4y' + 4y = x$:
$$-A\sin{x} - B\cos{x} - 4A\cos{x} + 4B\sin{x} + 4A\sin{x} + 4B\cos{x} = -\sin{x}$$
so for the sines: $$3A + 4B = -1$$ for the cosines: $$-3B - 4A = 0$$ solving: $$-3B = 4A$$ $$\frac{-3}{4}B = A$$ $$\frac{-9}{4}B + 4B = -1$$ $$\frac{7}{4}B = -1$$ $$B = \frac{-4}{7}$$ $$A = \frac{12}{28}$$
so summing all together:
general solution
$$y = c_1e^{2x} + c_2xe^{2x} + \frac{1}{4}x + \frac{1}{4} + \frac{12}{28}\sin x -\frac{4}{7}\cos x$$
Is this right?