Finding the general solution of differential equation y "+ y = e Λ - x

Finding the general solution of differential equation y "+ y = e Λ - x

The characteristic equation is R ^ 2 + 1 = 0, r = I, - I
The general solution of homogeneous equation is Y1 = c1cosx + c2sinx
Let the special solution be y * = AE ^ (- x), then y * "= AE ^ (- x)
Substitution equation: AE ^ (- x) + AE ^ (- x) = e ^ (- x)
A = 0.5
So the general solution is y = Y1 + y * = c1cosx + c2sinx + 0.5E ^ (- x)