$\left\{x \cos \left(\frac{y}{x}\right)+y \sin \left(\frac{y}{x}\right)\right\} y d x=\left\{y \sin \left(\frac{y}{x}\right)-x \cos \left(\frac{y}{x}\right)\right\} x d y$
The given differential equation is:
$\left\{x \cos \left(\frac{y}{x}\right)+y \sin \left(\frac{y}{x}\right)\right\} y d x=\left\{y \sin \left(\frac{y}{x}\right)-x \cos \left(\frac{y}{x}\right)\right\} x d y$
$\frac{d y}{d x}=\frac{\left\{x \cos \left(\frac{y}{x}\right)+y \sin \left(\frac{y}{x}\right)\right\} y}{\left\{y \sin \left(\frac{y}{x}\right)-x \cos \left(\frac{y}{x}\right)\right\} x}$ ...(1)
Let $F(x, y)=\frac{\left\{x \cos \left(\frac{y}{x}\right)+y \sin \left(\frac{y}{x}\right)\right\} y}{\left\{y \sin \left(\frac{y}{x}\right)-x \cos \left(\frac{y}{x}\right)\right\} x}$.
$\therefore F(\lambda x, \lambda y)=\frac{\left\{\lambda x \cos \left(\frac{\lambda y}{\lambda x}\right)+\lambda y \sin \left(\frac{\lambda y}{\lambda x}\right)\right\} \lambda y}{\left\{\lambda y \sin \left(\frac{\lambda y}{\lambda x}\right)-\lambda x \sin \left(\frac{\lambda y}{\lambda x}\right)\right\} \lambda x}$
$=\frac{\left\{x \cos \left(\frac{y}{x}\right)+y \sin \left(\frac{y}{x}\right)\right\}}{\left\{y \sin \left(\frac{y}{x}\right)-x \cos \left(\frac{y}{x}\right)\right\}} x$
$=\lambda^{0} \cdot F(x, y)$
Therefore, the given differential equation is a homogeneous equation.
To solve it, we make the substitution as:
y = vx
$\Rightarrow \frac{d y}{d x}=v+x=\frac{d v}{d x}$
Substituting the values of $y$ and $\frac{d y}{d x}$ in equation (1), we get:
$v+x \frac{d v}{d x}=\frac{(x \cos v+v x \sin v) \cdot v x}{(v x \sin v-x \cos v) \cdot x}$
$\Rightarrow v+x \frac{d v}{d x}=\frac{v \cos v+v^{2} \sin v}{v \sin v-\cos v}$
$\Rightarrow x \frac{d v}{d x}=\frac{v \cos v+v^{2} \sin v}{v \sin v-\cos v}-v$
$\Rightarrow x \frac{d v}{d x}=\frac{v \cos v+v^{2} \sin v-v^{2} \sin v+v \cos v}{v \sin v-\cos v}$
$\Rightarrow x \frac{d v}{d x}=\frac{2 v \cos v}{v \sin v-\cos v}$
$\Rightarrow\left[\frac{v \sin v-\cos v}{v \cos v}\right] d v=\frac{2 d x}{x}$
$\Rightarrow\left(\tan v-\frac{1}{v}\right) d v=\frac{2 d x}{x}$
Integrating both sides, we get:
$\log (\sec v)-\log v=2 \log x+\log \mathrm{C}$
$\Rightarrow \log \left(\frac{\sec v}{v}\right)=\log \left(\mathrm{C} x^{2}\right)$
$\Rightarrow\left(\frac{\sec v}{v}\right)=\mathrm{C} x^{2}$
$\Rightarrow \sec v=\mathrm{C} x^{2} v$
$\Rightarrow \sec \left(\frac{y}{x}\right)=\mathrm{C} \cdot x^{2} \cdot \frac{y}{x}$
$\Rightarrow \sec \left(\frac{y}{x}\right)=\mathrm{C} x y$
$\Rightarrow \cos \left(\frac{y}{x}\right)=\frac{1}{\mathrm{C} x y}=\frac{1}{\mathrm{C}} \cdot \frac{1}{x y}$
$\Rightarrow x y \cos \left(\frac{y}{x}\right)=k$ $\left(k=\frac{1}{\mathrm{C}}\right)$
This is the required solution of the given differential equation.