Question:

Solve the differential equation: \[ \frac{dy}{dx} - y = \cos x \]

Show Hint

For first-order linear differential equations, always compute the Integrating Factor (IF) and reduce it to the derivative of $(y \cdot IF)$.
Updated On: Oct 4, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Step 1: Standard form. \[\frac{dy}{dx} - y = \cos x\] This is a linear differential equation of the form: \[\frac{dy}{dx} + P(x) y = Q(x), P(x) = -1, \; Q(x) = \cos x\]

Step 2: Find the integrating factor (IF). \[IF = e^{\int P(x)dx} = e^{\int -1 dx} = e^{-x}\]

Step 3: Multiply through by IF. \[e^{-x}\frac{dy}{dx} - e^{-x}y = e^{-x}\cos x\] \[\implies \frac{d}{dx}(y e^{-x}) = e^{-x}\cos x\]

Step 4: Integrate both sides. \[y e^{-x} = \int e^{-x}\cos x \, dx + C\] Now, \[\int e^{-x}\cos x \, dx = \frac{e^{-x}(-\cos x + \sin x)}{2}\]

Step 5: Final solution. \[y e^{-x} = \frac{e^{-x}(\sin x - \cos x)}{2} + C\] \[y = \frac{\sin x - \cos x}{2} + Ce^{x}\]

Final Answer: \[ \boxed{y = \frac{\sin x - \cos x}{2} + Ce^{x}} \]

Was this answer helpful?
0
0