y''-y=2x+e^x
The aux. equation
r^2-1=0
r=1 or -1
let
yg=Ae^x +Be^(-x)
yp=Cx+D + Exe^x
yp'=C+E(1+x)e^x
yp''=E(2+x)e^x
yp''-yp=2x+e^x
E(2+x)e^x -[Cx+D + Exe^x] = 2x+e^x
-Cx -D +2Ee^x=2x+e^x
=>
C=-1/2 , D=0, E=1/2
yp=Cx+D + Exe^x = -(1/2)x +(1/2)x.e^x
通解
y= yg+yp=Ae^x +Be^(-x) -(1/2)x +(1/2)x.e^x