The solution of differential equation \(\displaystyle\frac{dy}{dx}+\frac{y}{x}=\cos x+\frac{\sin x}{x}\) is:
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → \(y=\sin x+\displaystyle\frac{C}{x}\)
This is a linear differential equation \(\frac{dy}{dx}+Py=Q\) with \(P = \frac{1}{x}\). The integrating factor is
\( \displaystyle \text{I.F.} = e^{\int\frac{1}{x}dx} = e^{\log x} = x \)
Multiplying the equation by x, the left side becomes the derivative of xy:
\( \displaystyle \frac{d}{dx}(xy) = x\cos x+\sin x \)
The right side is the derivative of \(x\sin x\) (product rule), so
\(xy = x\sin x+C\)
\( \displaystyle y = \sin x+\frac{C}{x} \)