Can't solve $\lim_{x\to + \infty} e^x(1-\frac{1}{x})^{x^2}$ I have
$$\lim_{x\to + \infty} e^x(1-\frac{1}{x})^{x^2}$$
and I tried to solve it with the substitution $x=-y$ in order to obtain 
$$\lim_{y\to - \infty} e^{-y}(1+\frac{1}{y})^{y^2}$$
and apply the fundamental limit
$$\lim_{x \to \infty}(1+\frac{1}{x})^x=e$$
This way I got the following result
$$\lim_{y \to - \infty}e^{-y}e^2=+\infty$$
but I found out it is wrong. The real solution should be $e^{-1/2}$. What am I doing wrong and how can I get to the real solution?
 A: Hint:
Determine the limit of the logarithm: $\;x+x^2\ln\Bigl(1-\dfrac1x\Bigr)$, and use Taylor's expansion at order $2$:
$$\ln\Bigl(1-\frac1x\Bigr)=-\frac1x-\frac1{2x^2}+o\Bigl(\frac1{x^2}\Bigr).$$
Can you proceed?
A: The following is an outline of how to do the problem without L'hopital's rule or Taylor series.
Try proving the following: for all $a>\frac{1}{2}$, $(1+\frac{1}{x})^{x+a}$ converges to $e$ from above, and for all $a<\frac{1}{2}$ it converges from below.
Then for all $0<a < \frac{1}{2} < b<1$ we have $(1+\frac{1}{x})^{x+a} < e < (1+\frac{1}{x})^{x+b}$ we  get $(1+\frac{1}{x})^{x(x+a)} < e^x < (1+\frac{1}{x})^{x(x+b)}$.
Substituting this in, we have $e^x (1-\frac{1}{x})^{x^2} > (1+\frac{1}{x})^{x^2+ax} (1-\frac{1}{x})^{x^2} = (1 - \frac{1}{x^2})^{x^2} (1+\frac{1}{x})^{ax}$. This approaches $e^{-1} e^a = e^{1-a}$. Similarly, we can obtain an upper bound of $e^{1-b}$. Taking $a$ and $b$ arbitrarily close to $\frac{1}{2}$ yields the required result.
A: One way to deal with this is by using logarithms. For $x>1$, we have
$$
e^x\left(1 - \frac1x\right)^{x^2} = \exp\left(\ln(e^x) + x^2\ln\left(1-\frac1x\right)\right)
$$
(where $\exp(y)$ is just another way of writing $e^y$, for readability). The first term is almost trivial. The limit of the second term may be found by for instance using Taylor series like the other answers suggest. Or, equivalently, l'Hopital.
A: HINT 
Let $L=\lim_{x\to \infty}e^x\left(1-\frac{1}{x}\right)^{x^2}$. 


*

*Substitute $y=\frac{1}{x}$

*Take the natural logarithm of both sides

*Apply l'hopital's rule

