Solve the differential equation $\;\;$ $y \; dx + x \; \log \left(\dfrac{y}{x}\right) \; dy = 2 \; x \; dy$
The given differential equation is $\;\;$ $y \; dx + x \; \log \left(\dfrac{y}{x}\right) \; dy = 2 \; x \; dy$
i.e. $\dfrac{y}{x} \; dx + \log \left(\dfrac{y}{x}\right) \; dy = 2 \; dy$
i.e. $\left[2 - \log \left(\dfrac{y}{x}\right)\right] \; dy = \dfrac{y}{x} \; dx$
i.e. $\dfrac{dy}{dx} = \dfrac{\dfrac{y}{x}}{2 - \log \left(\dfrac{y}{x}\right)}$ $\;\;\; \cdots \; (1)$
Let $\dfrac{y}{x} = v$ $\;\;\; \cdots \; (2a)$
i.e. $y = v \; x$ $\;\;\; \cdots \; (2b)$
Differentiating equation $(2b)$ w.r.t $x$ gives
$\dfrac{dy}{dx} = v + x \; \dfrac{dv}{dx}$ $\;\;\; \cdots \; (2c)$
$\therefore$ $\;$ In view of equations $(2a)$ and $(2c)$, equation $(1)$ can be written as
$v + x \; \dfrac{dv}{dx} = \dfrac{v}{2 - \log \left(v\right)}$
i.e. $x \; \dfrac{dv}{dx} = \dfrac{v}{2 - \log \left(v\right)} - v$
i.e. $x \; \dfrac{dv}{dx} = \dfrac{v - 2 \; v + v \; \log \left(v\right)}{2 - \log \left(v\right)}$
i.e. $x \; \dfrac{dv}{dx} = \dfrac{v \; \log \left(v\right) - v}{2 - \log \left(v\right)}$
i.e. $\left[\dfrac{2 - \log \left(v\right)}{v \; \log \left(v\right) - v}\right] \; dv = \dfrac{dx}{x}$ $\;\;\; \cdots \; (3)$
Integrating equation $(3)$ gives
$\displaystyle \int \left[\dfrac{2 - \log \left(v\right)}{v \; \log \left(v\right) - v}\right] \; dv = \int \dfrac{dx}{x}$
i.e. $2 \displaystyle \int \dfrac{dv}{v \; \log \left(v\right) - v} - \int \dfrac{\log \left(v\right)}{v \; \log \left(v\right) - v} \; dv = \int \dfrac{dx}{x}$ $\;\;\; \cdots \; (4)$
Consider $\displaystyle \int \dfrac{dv}{v \; \log \left(v\right) - v} = \int \dfrac{dv}{v \left[\log \left(v\right) - 1\right]}$ $\;\;\; \cdots \; (5)$
Let $\log \left(v\right) - 1 = p$ $\;\;\; \cdots \; (5a)$
Differentiating equation $(5a)$ gives
$\dfrac{dv}{v} = dp$ $\;\;\; \cdots \; (5b)$
$\therefore$ $\;$ In view of equations $(5a)$ and $(5b)$, equation $(5)$ becomes
$\displaystyle \int \dfrac{dv}{v \; \log \left(v\right) - v} = \int \dfrac{dp}{p}$ $\;\;\; \cdots \; (5c)$
Consider $\displaystyle \int \dfrac{\log \left(v\right)}{v \; \log \left(v\right) - v} \; dv$ $\;\;\; \cdots \; (6)$
Let $v \; \log \left(v\right) - v = u$ $\;\;\; \cdots \; (6a)$
Differentiating equation $(6a)$ gives
$\left[v \times \dfrac{1}{v} + \log \left(v\right) - 1\right] \; dv = du$
i.e. $\log \left(v\right) \; dv = du$ $\;\;\; \cdots \; (6b)$
$\therefore$ $\;$ In view of equations $(6a)$ and $(6b)$, equation $(6)$ becomes
$\displaystyle \int \dfrac{\log \left(v\right)}{v \; \log \left(v\right) - v} \; dv = \int \dfrac{du}{u}$ $\;\;\; \cdots \; (6c)$
$\therefore$ $\;$ In view of equations $(5c)$ and $(6c)$, equation $(4)$ becomes
$2 \displaystyle \int \dfrac{dp}{p} - \int \dfrac{du}{u} = \int \dfrac{dx}{x}$
i.e. $2 \log \left|p\right| - \log \left|u\right| = \log \left|x\right| + \log \left|c\right|$
i.e. $\log \left|\dfrac{p^2}{u}\right| = \log \left|c \; x\right|$
i.e. $\dfrac{p^2}{u} = c \; x$ $\;\;\; \cdots \; (7)$
Substituting the values of $p$ and $u$ from equations $(5a)$ and $(6a)$, respectively, in equation $(7)$, we have
$\dfrac{\left[\log \left|v\right| - 1\right]^2}{v \; \log \left|v\right| - v} = c \; x$
i.e. $\dfrac{\left[\log \left|v\right| - 1\right]^2}{v \left[\log \left|v\right| - 1\right]} = c \; x$
i.e. $\dfrac{\log \left|v\right| - 1}{v} = c \; x$
i.e. $\log \left|v\right| - 1 = c \; x \; v$ $\;\;\; \cdots \; (8)$
In view of equation $(2a)$, equation $(8)$ becomes
$\log \left|\dfrac{y}{x}\right| - 1 = c \times x \times \dfrac{y}{x}$
i.e. $\log \left|\dfrac{y}{x}\right| - 1 = c \; y$ $\;\;\; \cdots \; (9)$
Equation $(9)$ is the general solution of the given differential equation.