Check $\;y=\dfrac{\sin x}{x}\;$ is solution of $\;xy'+y=\cos x\;$ How can I check that $\;y=\dfrac{\sin x}{x}\;$ is a solution of $\;xy'+y=\cos x\;$?

Using the quotient rule for differentiation, we have $$xy'+y=x\left(\frac{x\cos x-\sin x}{x^2}\right)+y=\cos x-\frac{\sin x}{x}+\frac{\sin x}{x}=\cos x.$$
