Step 1: Confirm homogeneity by checking the degree of $x$ and $y$ together, before substituting:
Rewrite as $x\cos(y/x)\,dy - y\cos(y/x)\,dx = x\,dx$, i.e. $x\cos(y/x)\,dy - [y\cos(y/x)+x]\,dx=0$. Both coefficients depend only on the ratio $y/x$ (after factoring out $x$), confirming this is homogeneous of degree one, so $y=vx$ is the right substitution.
Step 2: Substitute $y=vx$ and $dy=v\,dx+x\,dv$ directly into the differential form:
$x\cos v\,(v\,dx+x\,dv) - [vx\cos v + x]\,dx = 0$
Step 3: Expand and collect terms:
$xv\cos v\,dx + x^2\cos v\,dv - vx\cos v\,dx - x\,dx = 0$. The $xv\cos v\,dx$ terms cancel, leaving $x^2\cos v\,dv = x\,dx$.
Step 4: Divide through by $x^2$ to separate the variables:
$\cos v\,dv = \dfrac{dx}{x}$.
Step 5: Integrate both sides and restore $v=y/x$:
$\sin v = \ln|x|+C \Rightarrow \sin(y/x)=\ln|x|+C$.
Final Answer:
The general solution is $\sin(y/x)=\ln|x|+C$.
\[ \boxed{\sin\left(\dfrac{y}{x}\right)=\ln|x|+C} \]