TITLE: Why does the limit definition of e fail?
QUESTION [6 upvotes]: I'm trying to calculate the following limit:
$$\lim_{x\to +\infty} \frac{(1+\frac{1}{x})^{x^2}}{e^x}$$
I tried to use the fact that $e^x = \lim_{x\to +\infty}(1+\frac{1}{x})^{x}$, but this gives $\frac {e^x}{e^x} = 1,$ which is not the answer. WolframAlpha says the answer should be $\frac {1}{\sqrt{e}}$. I was able to get the right answer using Taylor series of $\ln(1+ \frac{1}{x})$, but I can't find a good reason why my first approach fails. Can someone please help? Thanks!

REPLY [15 votes]: Your first approach uses the reasoning

$(1+\frac1x)^x$ is approximately $e$, so $(1+\frac1x)^{x^2}=[(1+\frac1x)^x]^x$ behaves like $e^x$.

This is illegal because you're letting $x\to\infty$ in your inner expression while preventing $x\to\infty$ in the outer expression. There's no rule that allows you to do that -- you can't hold $x$ fixed in one part of your expression while letting it tend to infinity in another part.
As a simpler example, it is incorrect to compute $\lim_{n\to\infty}1$ by writing $1=\frac1n\cdot n$, then observing that $\frac1n\to0$ as $n\to\infty$, and deducing that
$$
\lim_{n\to\infty}1 = \lim_{n\to\infty}\left[ \left(\lim_{n\to\infty}\frac 1n\right)\cdot n \right]= \lim_{n\to\infty}(0\cdot n) = 0.
$$
Another simpler, but relevant example: $(1+\frac1x)$ tends to $1$ as $x\to\infty$, but it doesn't follow that
$$\lim_{x\to\infty}\left(1+\frac1x\right)^x = \lim_{x\to\infty}\left[\lim_{x\to\infty}\left(1+\frac1x\right)\right]^x=\lim_{x\to\infty} 1^x = 1.
$$