y"-3y'+2y=cos(x).
The characteristic solution is found by solving y"-3y'+2y=0.
Replace this with the quadratic r2-3r+2=(r-2)(r-1)⇒yc=Ae2x+Bex, where A and B are arbitrary constants.
Now we need a particular solution of the form yp=asin(x)+bcos(x), where a and b are specific constants to be found. We assume this form for the solution because we have the cosine function cos(x).
yp'=acos(x)-bsin(x); yp"=-asin(x)-bcos(x). Substitute in the DE:
-asin(x)-bcos(x)-3(acos(x)-bsin(x))+2(asin(x)+bcos(x))=
sin(x)(-a+3b+2a)+cos(x)(-b-3a+2b)≡cos(x) by matching coefficients:
a+3b=0 and -3a+b=1. So a=-3b⇒10b=1, b=0.1⇒a=-0.3.
So yp=-0.3sin(x)+0.1cos(x).
[yp"-3yp'+2yp=(0.3sin(x)-0.1cos(x))-3(-0.3cos(x)-0.1sin(x))+2(-0.3sin(x)+0.1cos(x))=
sin(x)(0.3+0.3-0.6)+cos(x)(-0.1+0.9+0.2)=cos(x), so yp is correct.
y=yc+yp=Ae2x+Bex-0.3sin(x)+0.1cos(x) is the complete solution.