<s>[INST] Find $\lim_{x \to \infty} \left(\frac{x^2+1}{x^2-1}\right)^{x^2}$ How to calculate the following limit?
$$\lim\limits_{x \to \infty} \left(\frac{x^2+1}{x^2-1}\right)^{x^2}$$
 [/INST] You can do it using L'Hopital's rule this way:
$$\begin{align}
\lim\limits_{x \to \infty} \Big(\frac{x^2+1}{x^2-1}\Big)^{x^2} = \lim\limits_{x \to \infty} \exp\ln\Big(\frac{x^2+1}{x^2-1}\Big)^{x^2} &= \lim\limits_{x \to \infty} \exp x^2\ln\Big(\frac{x^2+1}{x^2-1}\Big) \\ &= \exp \lim\limits_{x \to \infty} \frac{\ln(x^2+1)-\ln(x^2-1)}{x^{-2}} \\ &= \exp \lim\limits_{x \to \infty} \frac{2x(x^2+1)^{-1}-2x(x^2-1)^{-1}}{-2x^{-3}} \\ &= \exp \lim\limits_{x \to \infty} \frac{x^4(x^2+1)-x^4(x^2-1)}{(x^2+1)(x^2-1)} \\ &= \exp \lim\limits_{x \to \infty} \frac{2x^4}{(x^2+1)(x^2-1)} \\ &= e^2
\end{align}$$
It's permissible to swap the $\exp$ with the $\lim$ between lines one and two because the exponential function is continuous, and L'Hopital's rule is applied between lines two and three.
</s>