Why does $\lim_{x\rightarrow\infty} x-x^{\frac{1}{x}^{\frac{1}{x}}}-\log^2x=0?$ Why does $$\lim_{x\rightarrow\infty} x-x^{\frac{1}{x}^{\frac{1}{x}}}-\log^2x=0?$$
Moreover, why is $$x-x^{\frac{1}{x}^{\frac{1}{x}}}\approx\log^2 x?$$
 A: By a Taylor expansion,
$$
\left( \frac{1}{x} \right)^{1/x} = \exp\left( -\frac{1}{x}\ln x \right) = 1-\frac{\ln x}{x} + O\left(\frac{\ln^2 x}{x^2}\right) .
$$
Thus the second term equals
$$
(1+\delta)\exp\left( \ln x \left( 1 - \frac{\ln x}{x} \right) \right)  = x \left( 1-\frac{\ln^2 x}{x} + O\left(\frac{\ln^4 x}{x^2}\right) \right)(1+\delta)
$$
with $\delta = O(\ln^3 x/x^2)$, so this gives the claim.
A: I give a completely rigorous proof. 
Let $y=\frac{1}{x}$ then the expression reads
$$\frac{1}{y}-y^{-y^y}-\ln^2 y$$
Now 
$$y^{-y^y}=e^{-\ln y  e^{y\ln y}}.$$
Note that $$\lim\limits_{x \rightarrow 0}\frac{e^x-1-x}{x}=0$$
therefore
$$\lim\limits_{y \rightarrow 0}\frac{e^{y\ln y}-1-y\ln y}{y\ln y}=0$$
And since $$\lim\limits_{y \rightarrow 0} y \ln^2 y=0$$ we have 
$$\lim\limits_{y \rightarrow 0}\ln y(e^{y\ln y}-1-y\ln y)=0$$
and so 
$$\lim\limits_{y \rightarrow 0}e^{\ln y(e^{y\ln y}-1-y\ln y)}=1$$
Now we have 
$$e^{-\ln y  e^{y\ln y}}=e^{-\ln y (1+y\ln y)}e^{-\ln y (e^{y\ln y}-1-y\ln y)} $$
We shall want to multiply the entire limit by $e^{\ln y (e^{y\ln y}-1-y\ln y)} $
This gives us 
$$\left(\frac{1}{y}-\ln^2 y\right)e^{\ln y (e^{y\ln y}-1-y\ln y)}-  e^{-\ln y (1+y\ln y)}$$
And we want to know that 
$$\left(\frac{1}{y}-\ln^2 y\right)(e^{\ln y (e^{y\ln y}-1-y\ln y)}-1)\rightarrow 0$$ which will reduce the question to finding the limit of 
$$\left(\frac{1}{y}-\ln^2 y\right)-e^{-\ln y (1+y\ln y)}.$$
The proof of this last limit is actually not so difficult, 
$\frac{e^x-1}{x}\rightarrow 1$ as $x\rightarrow 0$ so
 $$\frac{e^{\ln y (e^{y\ln y}-1-y\ln y)}-1}{\ln y (e^{y\ln y}-1-y\ln y)}\rightarrow 1$$
Further since $\frac{e^x-1-x}{x^2}\rightarrow \frac{1}{2}$ we get 
$$\frac{e^{y\ln y}-1-y\ln y}{y^2\ln^2 y}\rightarrow \frac{1}{2}$$ and we are reduced to looking at the limit $$y^2\ln^2 y\left(\frac{1}{y}-\ln^2 y\right)$$ as this limit is clearly zero. Thus we have shown the limit above and now the problem is completely reduced to the limit of $$\left(\frac{1}{y}-\ln^2 y\right)-e^{-\ln y (1+y\ln y)}.$$
Here we have 
$$e^{-\ln y (1+y\ln y)}=\frac{1}{y}e^{-y\ln^2 y}$$
Now note that 
$$\lim\limits_{x \rightarrow 0}\frac{e^x-1-x}{x^2}=\frac{1}{2}$$ and therefore 
$$\lim\limits_{y \rightarrow 0}\frac{e^{-y\ln^2 y}-1+y\ln^2 y}{y^2\ln^4 y}=-\frac{1}{2}$$
and since 
$$\lim\limits_{y \rightarrow 0} y\ln^4 y=0$$ we have 
$$\lim\limits_{y \rightarrow 0}\frac{e^{-y\ln^2 y}-1+y\ln^2 y}{y}=0$$
Now $$\frac{1}{y}e^{-y\ln^2 y}-\frac{1}{y}+\ln^2 y=\frac{e^{-y\ln^2 y}-1+y\ln^2 y}{y}$$ so we are finished. Its so easy....
