Solve the differential equation $\;\;$ $\dfrac{dy}{dx} + \dfrac{y \left(x + y\right)}{x^2} = 0$
The given differential equation is $\;\;$ $\dfrac{dy}{dx} + \dfrac{y \left(x + y\right)}{x^2} = 0$
i.e. $\dfrac{dy}{dx} + \dfrac{y \; x + y^2}{x^2} = 0$
i.e. $\dfrac{dy}{dx} + \dfrac{y}{x} + \dfrac{y^2}{x^2} = 0$ $\;\;\; \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} + v + v^2 = 0$
i.e. $x \; \dfrac{dv}{dx} = - 2 v - v^2$
i.e. $\dfrac{dv}{2 \; v + v^2} = - \dfrac{dx}{x}$ $\;\;\; \cdots \; (3)$
Integrating equation $(3)$ gives
$\displaystyle \int \dfrac{dv}{2 \; v + v^2} = - \int \dfrac{dx}{x}$
i.e. $\displaystyle \int \dfrac{dv}{v \left(2 + v\right)} = - \int \dfrac{dx}{x}$ $\;\;\; \cdots \; (4)$
Let $\dfrac{1}{v \left(2 + v\right)} = \dfrac{A}{v} + \dfrac{B}{2 + v}$ $\;\;\; \cdots \; (5)$
i.e. $1 = A \left(2 + v\right) + B \; v$ $\;\;\; \cdots \; (5a)$
In equation $(5a)$
$\begin{aligned}
\text{When } & v = 0, & \implies 1 = 2 \; A & \implies A = \dfrac{1}{2} \;\;\; \cdots \; (5b) \\\\
\text{When } & v = -2, & \implies 1 = -2 \; B & \implies B = \dfrac{-1}{2} \;\;\; \cdots \; (5c)
\end{aligned}$
$\therefore$ $\;$ In view of equations $(5b)$ and $(5c)$, equation $(5)$ becomes
$\dfrac{1}{v \left(2 + v\right)} = \dfrac{1 / 2}{v} - \dfrac{1 / 2}{2 + v}$ $\;\;\; \cdots \; (6)$
Integrating equation $(6)$ gives
$\displaystyle \int \dfrac{dv}{v \left(2 + v\right)} = \dfrac{1}{2} \int \dfrac{dv}{v} - \dfrac{1}{2} \int \dfrac{dv}{v + 2}$ $\;\;\; \cdots \; (6a)$
$\therefore$ $\;$ In view of equation $(6a)$, equation $(4)$ can be written as
$\displaystyle \dfrac{1}{2} \int \dfrac{dv}{v} - \dfrac{1}{2} \int \dfrac{dv}{v + 2} = - \int \dfrac{dx}{x}$
i.e. $\dfrac{1}{2} \log \left|v\right| - \dfrac{1}{2} \log \left|v + 2\right| = - \log \left|x\right| + \log \left|c_1\right|$
i.e. $\dfrac{1}{2} \log \left|\dfrac{v}{v + 2}\right| = \log \left|\dfrac{c_1}{x}\right|$
i.e. $\log \left|\dfrac{v}{v + 2}\right| = 2 \log \left|\dfrac{c_1}{x}\right|$
i.e. $\log \left|\dfrac{v}{v + 2}\right| = \log \left|\left(\dfrac{c_1}{x}\right)^2\right|$
i.e. $\dfrac{v}{v + 2} = \dfrac{c}{x^2}$ $\;\;\; \cdots \; (7)$ $\;$ where $\left(c_1\right)^2 = c$
Substituting the value of $v$ from equation $(2a)$ in equation $(7)$ gives
$\dfrac{\dfrac{y}{x}}{\dfrac{y}{x} + 2} = \dfrac{c}{x^2}$
i.e. $\dfrac{y}{y + 2x} = \dfrac{c}{x^2}$
i.e. $x^2 y = c \left(y + 2x\right)$ $\;\;\; \cdots \; (8)$
Equation $(8)$ is the general solution of the given differential equation.