y''+y=cosx.cos2x =(1/2)(cosx+cos3x)
The aux. equation
r^2 +1 =0
r=i or -i
let
yg=Acosx+Bsinx
yp=Ccos3x + Dxsinx +Excosx
yp'
=-3Csin3x + Dxcosx +Dsinx -Exsinx +Ecosx
yp''
=-9Ccos3x -Dxsinx +Dcosx +Dcosx -Excosx -Esinx -Esinx
=-9Ccos3x -Dxsinx +2Dcosx -Excosx -2Esinx
yp''+yp =(1/2)(cosx+cos3x)
[-9Ccos3x -Dxsinx +2Dcosx -Excosx -2Esinx]+[Ccos3x + Dxsinx +Excosx]
=(1/2)(cosx+cos3x)
-8Ccos3x +2Dcosx-2Esinx =(1/2)(cosx+cos3x)
=>
C=-1/16 and D=1/4 and E=0
ie
yp=-(1/16)cos3x + (1/4)xsinx
y=yg+yp=Acosx+Bsinx -(1/16)cos3x + (1/4)xsinx
The aux. equation
r^2 +1 =0
r=i or -i
let
yg=Acosx+Bsinx
yp=Ccos3x + Dxsinx +Excosx
yp'
=-3Csin3x + Dxcosx +Dsinx -Exsinx +Ecosx
yp''
=-9Ccos3x -Dxsinx +Dcosx +Dcosx -Excosx -Esinx -Esinx
=-9Ccos3x -Dxsinx +2Dcosx -Excosx -2Esinx
yp''+yp =(1/2)(cosx+cos3x)
[-9Ccos3x -Dxsinx +2Dcosx -Excosx -2Esinx]+[Ccos3x + Dxsinx +Excosx]
=(1/2)(cosx+cos3x)
-8Ccos3x +2Dcosx-2Esinx =(1/2)(cosx+cos3x)
=>
C=-1/16 and D=1/4 and E=0
ie
yp=-(1/16)cos3x + (1/4)xsinx
y=yg+yp=Acosx+Bsinx -(1/16)cos3x + (1/4)xsinx