Step 1: Isolating dy/dx first, before substituting:
Expand and collect: \(y'\big[xy\sin(y/x)-x^2\cos(y/x)\big]=y^2\sin(y/x)+xy\cos(y/x)\), giving \(y'\) explicitly as a function of \(y/x\) alone — confirming homogeneity from a different angle.
Step 2: Applying v=y/x directly to this explicit derivative form:
With \(y=vx\), \(y'=v+xv'\). Substitute \(y/x=v\) throughout: \(v+xv'=\dfrac{v^2\sin v+v\cos v}{v\sin v-\cos v}\).
Step 3: Simplifying the right side minus v:
\(xv'=\dfrac{v^2\sin v+v\cos v}{v\sin v-\cos v}-v=\dfrac{v^2\sin v+v\cos v-v^2\sin v+v\cos v}{v\sin v-\cos v}=\dfrac{2v\cos v}{v\sin v-\cos v}\).
Step 4: Separating and integrating (same separable form reached independently):
\(\dfrac{v\sin v-\cos v}{2v\cos v}dv=\dfrac{dx}{x}\), which on splitting into \(\big(\tfrac12\tan v-\tfrac1{2v}\big)dv=dx/x\) integrates to the same relation \(\ln|v\cos v|=-2\ln x+C\), i.e. \(xy\cos(y/x)=C\).
Final Answer:
\[ \boxed{xy\cos(y/x)=C} \]