How find the minimum of $a$ ,if $f(x)=-\frac{\ln{x}}{x}+e^{ax-1}-a,x>0$ Question:

let $$f(x)=-\dfrac{\ln{x}}{x}+e^{ax-1}-a,x>0$$
  if such $$f(x)_{min}=0,\forall x>0$$

**Question:
Find the $a$ minimum of the value.
My idea: this problem equivalent to
$$-\dfrac{\ln{x}}{x}+e^{ax-1}\ge a,\forall x>0$$
then we find the minimun of the $a$
then 
$$f'(x)=-\dfrac{1-\ln{x}}{x^2}+ae^{ax-1}$$
let $f'(x)=0$ I can't find the solution.so How solve it ?
Thank you very much
 A: Here is my idea: For all of this work, $\large{\color{red}{x\gt0}}.$


*

*Obvious case: $\large{\color{blue}{a=0}}:$
Here, the derivative is given by: $f'(x)=\dfrac{-1+\log x}{x^2}$ which has a minimum at $x=e$ with value $\dfrac{-1}{e}$.

*Next level cases: $\large{\color{blue}{a\neq0}}:$ Here, the trick that I used is the following:
$$f'(x)=\dfrac{-1+\log x+ax^2e^{ax}e^{-1}}{x^2}.$$
Since $x\gt0$, the sign of $f'(x)$ depends only on the numerator. Namely, $$f_1(x)=-1+\log x+ax^2e^{ax}e^{-1}.$$
To get the sign, calculate the derivative:
$$f'_1(x)=\dfrac{1}{x}+a^2e^{-1}x^2e^{ax}+2ae^{-1}xe^{ax}=\dfrac{1+a^2e^{-1}x^3e^{ax}+2ae^{-1}x^2e^{ax}}{x}.$$
With the same reasoning, its sign depends only on the numerator. Namely, $$f_2(x)=1+a^2e^{-1}x^3e^{ax}+2ae^{-1}x^2e^{ax}.$$
To get the sign, calculate the derivative:
$$f'_2(x)=xe^{ax}\left(a^3e^{-1}x^2+5a^2e^{-1}x+4ae^{-1}\right).$$
Now, you see that the sign of $f'_2(x)$ depends on the sign of the quadratic equation: $$\left(a^3e^{-1}x^2+5a^2e^{-1}x+4ae^{-1}\right).$$
This quadratic equation has a discriminant $\Delta=9a^4e^{-2}$ and two roots: $x_1=\dfrac{-4}{a}$ and $x_2=\dfrac{-1}{a}$.
Then, if $\large{\color{blue}{a\gt0}}:$ the quadratic equation is $\gt0$ (i.e., $f'_2(x)\gt0$) and with limit calculation you can see that $f_2(x)\gt0$ and $\cdots$ continue until you reach the sign of $f'(x)$.
And, if $\large{\color{blue}{a\lt0}}:$ the quadratic equation changes sign between $x_1$ and $x_2$ (positive) and negative elsewhere. And $\cdots$ continue until you reach the sign of $f'(x)$.
I think my idea is clear and you can continue now. I hope you understand it and it is helpful. 
