do you mean $\displaystyle y' = \frac {x^3 - 2y}x$ ?? ....hey! you changed the question!
so you have $\displaystyle xy' +2y = \frac {\sin x}x$
divide through by $\displaystyle x$, we get
$\displaystyle y' + \frac 2xy = \frac {\sin x}{x^2}$
now solve using the integrating factor method