find value integral $\int_{1}^{2}f(x)dx$ For a function $f(x)$ determined and continuous with $\forall x\in $ $\Bbb R\setminus\left\{ 0 \right\}$  such that 
$$x^{2}f^{2}(x)+(2x-1)f(x)=xf'(x)-1$$ and $f(1)=-2$
Find 
$$\int_{1}^{2} f(x)dx $$
I write: 
$$(xf(x)+1)^{2}=(xf(x)+1)'$$ 
But I do not know how to proceed
 A: The easiest course of action seems to be to solve the ODE $(xf(x)+1)^{2}=(xf(x)+1)'$ rather than trying to use this property to compute the integral in some clever way.
If we write $g(x)=xf(x)+1$, the ODE becomes $g(x)^2=g'(x)$ with $g(1)=-1$.
As noted in the comments, this is a separable ODE.
The general solution is $g(x)=(C-x)^{-1}$ (where defined), and with $g(1)=-1$ we get $g(x)=-1/x$.
I am leaving the details out; it is a good exercise to solve this, and you can always ask a follow-up question for help if you get stuck.
We thus found that $xf(x)+1=-1/x$, so that $f(x)=-x^{-1}-x^{-2}$.
The integral is now straightforward to calculate.
A: Following from the comments, you can rewrite $g(x) = xf(x)+1$. Then 
$$ g(1) = 1\cdot f(1) + 1 = -1 $$
The equation becomes
$$ \frac{g'(x)}{(g(x))^2} = 1 $$
Then
$$ \left[-\frac{1}{g(x)}\right]' = 1 $$
Integrating both sides
$$ -\frac{1}{g(x)} = x + C $$
Using the initial condition as above, we have
$$ -\frac{1}{g(1)} = 1 + C \implies 1 + C = 1 \implies C = 0 $$
Solving for $g(x)$
$$ g(x) = -\frac{1}{x} $$
Solving for $f(x)$
$$ f(x) = \frac{g(x)-1}{x} = -\frac{1}{x^2} - \frac{1}{x} $$
You can now do the integration
