# Understanding steps in this problem - limits and exponentials

I saw this math problem and wanted to understand the solution. I think it's to do with differentiating limits, but I Wasn't sure what the rules were for derivatives with exponents that are functions and plugging it into Wolfram Alpha gave me very weird answers, but I could just be wrong about how to do it.

The problem starts with:

$$\lim\limits_{x_\to\infty}\left(1+\frac{a}{x}-\frac{4}{x^2}\right)^{2x}=e^3$$

And we want to find a.

The solution I saw started with this:

$$\lim\limits_{x_\to\infty}\left(1+\frac{a}{x}-\frac{4}{x^2}\right)^{2x}=e^{\left[\lim\limits_{x_\to\infty}\left(1+\frac{a}{x}-\frac{4}{x^2}-1\right)2x\right]}$$

And I was a litle unclear on how that step was reached; at first I thought that it was just setting the limit equal to the power that e was raised to, since the limit approaches 1 anyway, but then I saw that the limit looked like it had been differentiated but I wasn't sure of the "rule" when you have a function in the exponent (I know that differentiating the $$e^{f(x)}$$ gets you $$f'(x)e^{f(x)}$$ and that if $$f(x)=a^{g(x)}$$ then $$f'(x) = \ln(a)(a^{g(x)}g'(x))$$ but I am not quite clear of the steps here, if those are even the correct rules to apply. The rest of the steps to get the answer, a=3/2, make perfect sense to me, it's just that first one-- I feel like I am missing something stupidly obvious, or just some rule I can't recall. When I looked up the derivative of $$f(x)^{g(x)}$$ it looks like I should try taking the log of both sides method,

$$\left(1+\frac{a}{x}-\frac{4}{x^2}\right)^{2x}=y$$ $$\ln\left(1+\frac{a}{x}-\frac{4}{x^2}\right)^{2x}=\ln y$$ $$2x\ln\left(1+\frac{a}{x}-\frac{4}{x^2}\right)=y'/y$$

But this seems to lead to something really complex, and I feel like I am going way off the path here. Anyhow, assistance is much appreciated (again I suspect there is some simple rule I missed).

Hints: in $$2x\ln\left(1+\frac{a}{x}-\frac{4}{x^2}\right)$$ substitute $$t=1/x$$ and observe that

$$x \to \infty \iff t \to 0+0$$.

L'Hospital !

Note that $$\lim_{t\to 0}(1+t)^\frac 1t=e$$

Given $$\lim\limits_{x\to\infty}\left(1+\frac{a}{x}-\frac{4}{x^2}\right)^{2x}$$

Let $$\frac{a}{x}-\frac{4}{x^2}=t$$

$$\implies \lim\limits_{x\to\infty}\frac{a}{x}-\frac{4}{x^2}=\lim\limits_{t\to0}t$$

Plug this in the given equation to obtain

$$\lim\limits_{t\to0}(1+t)^{t\cdot\frac{2x}{t}}=\lim\limits_{t\to0}e^{2x.t}=\lim\limits_{x\to\infty}e^{2x(\frac{a}{x}-\frac{4}{x^2})}=e^{\lim\limits_{x\to\infty}2x(\frac{a}{x}-\frac{4}{x^2})}$$

I bet you can take it from here