Error term in asymptotic expansion of $(1+ax)^{-1/x}$ as $x\to\infty$ According to WA we have as $x\to\infty$
$$
(1+ax)^{-1/x}=1-\frac{\log ax}{x}+O(1/x^2).
$$
I am confused on how one obtains the error term. Here is what I tried
$$
(1+ax)^{-1/x}=\exp(-\tfrac{1}{x}\log(1+ax))=\exp(-\tfrac{1}{x}(\log ax+O(1/x))).
$$
Using the Taylor series for $e^x$ we have
$$
\exp(-\tfrac{1}{x}(\log ax+O(1/x)))=\sum_{k=0}^\infty\frac{1}{k!}(-\tfrac{1}{x}(\log ax+O(1/x)))^k=1-\frac{\log ax}{x}+O(1/x^2)+O((-\tfrac{1}{x}(\log ax+O(1/x)))^2).
$$
So it would seem my issue is that I am not convinced the last term is $O(1/x^2)$.  Could someone please clarify this for me?
 A: You are almost there when you wrote $(1+ax)^{-1/x}=\exp\left(-\frac1x\log(1+ax)\right)$. Since $x$ is very large, $\frac1x\log(1+ax)$ is very small because
$$
\lim_{x\to\infty}\frac{\log(1+ax)}x=0
$$
Thus, using the Taylor approximation for $\exp$ at $0$,
$$
\exp\left(-\frac1x\log(1+ax)\right)=1-\frac1x\log(1+ax)+O\!\left(\left(\frac{\log(1+ax)}x\right)^2\right)
$$
We also have that
$$
\begin{align}
\log(1+ax)
&=\log(ax)+\log\left(\frac{1+ax}{ax}\right)\\
&=\log(ax)+\log\left(1+\frac1{ax}\right)\\
&=\log(ax)+O\!\left(\frac1{ax}\right)\\
\end{align}
$$
Therefore,
$$
(1+ax)^{-1/x}=1-\frac{\log(ax)}x+O\!\left(\left(\frac{\log(x)}{x}\right)^2\right)
$$
In fact, since $e^x=1+x+\frac12x^2+O\!\left(x^3\right)$, the error term should be about $\frac12\left(\frac{\log(x)}{x}\right)^2$.
Thus, it seems that WA's error term is a bit too small.

This shows that the error is about $\frac12\left(\frac{\log(x)}{x}\right)^2$.
A: hint
$$\ln(1+ax)=\ln(ax)+\ln(1+\frac{1}{ax})$$
$$=\ln(ax)+\frac{1}{ax}+o(\frac 1x)$$
$$\frac{-\ln(1+ax)}{x}=-\frac{\ln(ax)}{x}-\frac{1}{ax^2}+o(\frac{1}{x^2})$$
$$=-\frac{\ln(ax)}{x}+O(\frac{1}{x^2})$$
now, take the exponential.
