Step 1: Solve the differential equation.
We are given the differential equation:
\[
\frac{dy}{dx} + 2y = e^{-x}
\]
This is a linear first-order differential equation. To solve it, we use the integrating factor method. The integrating factor is \( e^{\int 2dx} = e^{2x} \).
Step 2: Multiply through by the integrating factor.
Multiply the entire equation by \( e^{2x} \):
\[
e^{2x} \frac{dy}{dx} + 2y e^{2x} = e^{2x} e^{-x}
\]
Simplifying:
\[
\frac{d}{dx} \left( y e^{2x} \right) = e^{x}
\]
Step 3: Integrate both sides.
Now, integrate both sides with respect to \( x \):
\[
\int \frac{d}{dx} \left( y e^{2x} \right) dx = \int e^x dx
\]
\[
y e^{2x} = e^x + c
\]
Step 4: Conclusion.
Thus, the solution is \( \boxed{y e^{2x} = e^x + c} \).