Solution:
Now on both the sides applying log, we obtain
$\log y^{x}=\log x^{y}$
$x \log y=y \log x$
So now, with respect to ‘$x$’ on both sides apply differentiation , we obtain
$x\left[\frac{1}{y} \times \frac{d y}{d x}\right]+\log y(1)=y\left(\frac{1}{x}\right)+\log x\left(\frac{d y}{d x}\right)$
$\frac{x}{y} \frac{d y}{d x}-\log x \frac{d y}{d x}=\frac{y}{x}-\log y$
By taking $dy/dx$ as common,
$\frac{d y}{d x}\left(\frac{x}{y}-\log x\right)=\frac{y-x \log y}{x}$
$\frac{d y}{d x}\left(\frac{x-y \log x}{y}\right)=\frac{y-x \log y}{x}$
Now cross multiplying, we obtain
$\frac{d y}{d x}=\frac{y(y-x \log y)}{x(x-y \log x)}$