$$f(x)=\frac{\ln x}{x}-(x-1)$$
When I derivative the function, I got this: $\frac{1-\ln x-x^2}{x^2} $
And my problem is I don't know how to find the roots or zero of $1-\ln x-x^2$ to continue my exercise, but I know that the roots of it is $x=1$ because the exercise told us to show that at that point the graph got the peak, but I don't know how to find it.
Sorry for any language mistakes, English is not my first language, and thanks for the help in advance.
$$f(x)=\frac{\ln x}{x}-(x-1)$$
I assume the domain of the function to be $x>0$, since $\ln x$ is not defined for $x<0$ and $\frac{\ln x}{x}$ is not defined for $x=0$
Then $$f'(x) =\frac{x\cdot \frac{1}{x} -\ln x}{x^2}-1 = \frac{1-\ln x-x^2}{x^2}$$
Now notice that $f'(x)<0\quad \forall x>1$ which implies $f(x)$ is a decreasing function for $x>1$
Also notice that for $0<x<1 \quad \ln x<0$
Therefore $1>\ln x +x^2$ for $0<x<1$. Therefore for $0<x<1,f'(x)>0$
So we have that $0<x<1, f'(x)>0$ and $x>1, f'(x)<0$
Therefore at $x=1$ we must have a maximum, and we have shown above that it is a global maximum.
So the maximum of $f(x)$ is given by $f(1) = 0$