Step 1: Understanding the Concept:
Divide by \(x\sin x\) to get the standard linear form \(\frac{dy}{dx} + Py = Q\).
Step 2: Key Formula or Approach:
\(\frac{dy}{dx} + \left(\cot x + \frac1x\right)y = \frac1x\). The integrating factor is \(e^{\int P\,dx} = e^{\log\sin x + \log x} = x\sin x\).
Step 3: Detailed Explanation:
Multiply by the integrating factor: \(\frac{d}{dx}(y\cdot x\sin x) = \frac1x\cdot x\sin x = \sin x\).
Integrate: \(xy\sin x = -\cos x + c\).
\[ xy\sin x + \cos x = c \]
Final Answer:
The general solution is \(xy\sin x + \cos x = c\), option (D).
\[ \boxed{xy\sin x+\cos x=c} \]