This is a first-order linear differential equation. We can rewrite it as: \[ \frac{dy}{dx} + 2y = \cos x \] The integrating factor is \( e^{\int 2 \, dx} = e^{2x} \). Multiply both sides of the equation by \( e^{2x} \): \[ e^{2x} \frac{dy}{dx} + 2e^{2x} y = e^{2x} \cos x \] Now, the left-hand side is the derivative of \( e^{2x} y \). Integrating both sides gives: \[ e^{2x} y = \int e^{2x} \cos x \, dx \] We solve the integral \( \int e^{2x} \cos x \, dx \) using integration by parts or standard integral tables. The integral of \( e^{2x} \cos x \) is: \[ \int e^{2x} \cos x \, dx = \frac{e^{2x}}{5} (\cos x + 2 \sin x) \] Therefore, the solution to the differential equation is: \[ e^{2x} y = \frac{e^{2x}}{5} (\cos x + 2 \sin x) + C \] Solving for \( y \): \[ y = \frac{1}{5} (\cos x + 2 \sin x) + Ce^{-2x} \] Thus, the general solution to the differential equation is: \[ y = \frac{1}{5} (\cos x + 2 \sin x) + Ce^{-2x} \]