Assuming you meant (D^2+1)y, which is a second order DE:
y"+y=1+eˣ-x+e²ˣ.
Let y=y₁+y₂, and y₁"+y₁=0 and y₂"+y₂=1-x+eˣ+e²ˣ. If we can solve for y₁ and y₂, then we have solved for y.
Let y₁=Asin(x)+Bcos(x), then y₁"=-Asin(x)-Bcos(x)=y₁ so y₁"+y₁=0. A and B are constants.
Let y₂=a+bx+ceˣ+de²ˣ where a-d are constants to be found.
y₂'=b+ceˣ+2de²ˣ and y₂"=ceˣ+4de²ˣ, so y₂"+y₂=ceˣ+4de²ˣ+a+bx+ceˣ+de²ˣ≡1-x+eˣ+e²ˣ.
Matching coefficients:
a=1, b=-1, 2c=1, so c=½, 5d=1, so d=⅕.
y₂=1-x+½eˣ+⅕e²ˣ.
Therefore, y=Asin(x)+Bcos(x)+1-x+½eˣ+⅕e²ˣ.