# Limit involving logarithms and exponentials

How do I calculate:

$$\lim \limits_{n \to \infty}\left(1-e^{\left(\frac{t+ \log^2(n)}{t-\log(n)}\right)}\right)^n$$

It's from a Statistics exercise, I haven't done analysis for a long time. I think what I have to do is try to get it to look something like

$$\lim \limits_{n \to \infty}\left(1+\frac{A}{n}\right)^n$$ for a suitable $A$ and apply the standard limit $$\lim \limits_{n \to \infty}\left(1+\frac{A}{n}\right)^n = e^A$$ I am stuck though.

First note that as $n\to\infty$ we have \begin{align} \frac{t+ \log^2(n)}{t-\log(n)} &\sim-\log(n)\\ &\to-\infty \end{align} hence $e^{\frac{t+\log^2(n)}{t-\log(n)}}\to 0$. Since $\log(1+\varepsilon)\sim\varepsilon$ as $\varepsilon\to 0$, by taking logarithm, we have \begin{align} \lim_{n\to\infty}\log\left(1-e^{\frac{t+\log^2(n)}{t-\log(n)}}\right)^n &=\lim_{n \to \infty}n\log\left(1-e^{\frac{t+\log^2(n)}{t-\log(n)}}\right)\\ &\sim -ne^{\frac{t+\log^2(n)}{t-\log(n)}} \end{align} By taking logarithm again: \begin{align} \lim_{n\to\infty}\log\left(ne^{\frac{t+\log^2(n)}{t-\log(n)}}\right) &=\log n+\frac{t+\log^2(n)}{t-\log(n)}\\ &=\frac{1+\log(n)}{t-\log(n)}t\\ &\to -t \end{align} Consequently, $$\lim_{n\to\infty}\left(1-e^{\frac{t+\log^2(n)}{t-\log(n)}}\right)^n=e^{-e^{-t}}$$