Let $f:(0,+\infty)\to\mathbb R$ be a function with $f(1)=1$ which is differentiable and for which it applies:
$$xf(x)=1-x^2f'(x), \forall x>0$$
Show that $f(x)={1+\ln x\over x}, x>0$
Personal work:
$$xf(x)=1-x^2f'(x)\iff_{x\neq0} f(x)={1-x^2f'(x)\over x}$$ We know that $f(1)=1$, so: $$f(1)=1\iff{1-x^2f'(x)\over x}=1\iff1-x^2f'(x)=x\iff-x^2f'(x)=x-1\iff f'(x)={x-1\over -x^2}$$ That's what I got. What's the problem? The actual derivative of $f(x)$ is ${-\ln x\over x^2}$ and not $$\color{red}{x-1\over -x^2}$$
Actually it is $$x\left(\frac{1+\ln(x)}{x}\right)=1-x^2\left(\frac{-\ln(x)}{x^2}\right)$$