Find the general solution of the differential equation: dy/dx + y = cos(x)
Correct: A
This is a first-order linear differential equation. The integrating factor (IF) is e^(∫1 dx) = e^x. Multiplying the equation by e^x, we get e^x(dy/dx) + e^x y = e^x cos(x). This can be written as d/dx(y e^x) = e^x cos(x). Integrating both sides with respect to x, we get y e^x = ∫ e^x cos(x) dx. Let I = ∫ e^x cos(x) dx. Using integration by parts twice, I = e^x sin(x) - ∫ e^x sin(x) dx = e^x sin(x) - (-e^x cos(x) + ∫ e^x cos(x) dx) = e^x sin(x) + e^x cos(x) - I. Therefore, 2I = e^x (sin(x) + cos(x)), so I = (1/2)e^x (sin(x) + cos(x)) + c. Thus, y e^x = (1/2)e^x (sin(x) + cos(x)) + c, and y = (1/2)sin(x) + (1/2)cos(x) + ce^(-x).