solve differential equation $x^2\frac{dy}{dx}=2y^2+yx$ How to solve this equation?
$x^2\frac{dy}{dx}=2y^2+yx$
I tried to separate variables, but I always have both $x$ and $y$ on one side of equation.

$$x^2\frac{dy}{dx}=2y^2+yx \tag{1}$$
Dividing both sides by $x^2$ yields
$$\frac{dy}{dx} = 2\left(\frac{y}{x}\right)^2 + \left(\frac1x\right) y\tag{2}$$
This is the same as $$\frac{dy}{dx} - \left(\frac1x\right)y = 2y^2x^{-2}\tag{3}$$
This should look like a familiar problem now. You want a function of only $x$ on the RHS, so divide through by $y^2$ to get
$$y^{-2}\frac{dy}{dx} - \left(\frac1x\right)y^{-1} = 2x^{-2}\tag{4}$$
Now, let $v$ = $y^{-1}$ so that $\frac{dv}{dx} = -y^{-2}\frac{dy}{dx} \implies -\frac{dv}{dx} = y^{-2}\frac{dy}{dx}.$
Substituting into (4), we have
$$-\frac{dv}{dx} - \left(\frac1x\right) v = 2x^{-2}\tag{5}$$
Rewrite it in standard form:
$$\frac{dv}{dx} + \left(\frac1x\right) v = -2x^{-2}\tag{6}$$
This should be something you know how to solve using an integrating factor. If you need to me to fill in some more steps here, let me know.
You should find that $$y = -\frac{1}{\frac{2}{x} \ln|x| + \frac{C}{x}} \equiv-\frac{x}{2 \ln |x| + C} \equiv \frac{x}{C - 2\ln|x|}$$
