Limits problem to find the values of constants - a and b If $\lim_{x \to \infty}(1+\frac{a}{x}+\frac{b}{x^2})^{2x}=e^2$ Find the value of $a$ and $b$. Problem : 
If $\lim\limits_{x \to \infty}\left(1+\frac{a}{x}+\frac{b}{x^2}\right)^{2x}=e^2$ Find the value of $a$ and $b$.
Please suggest how to proceed this problem : 
If we know that $\lim\limits_{x \to \infty}\left( 1+\frac{1}{x}\right)^x= e$ 
Will this work somehow... please suggest
 A: Take logs of both sides to get
$$2 = \lim_{x \to \infty} 2 x \log{\left ( 1+ \frac{a}{x} + \frac{b}{x^2}\right)}$$
Use $\log{(1+y)} \sim y - (y^2)/2$ as $y \to 0$ to get
$$2 = \lim_{x \to \infty} \left ( 2 a + \frac{2 b-a^2}{x}\right)$$
So we require $a=1$.  The value of $b$ is unimportant.
ADDENDUM
Details of the expansion of the log term to $O(1/x^2)$:
$$\begin{align}\log{\left ( 1+ \frac{a}{x} + \frac{b}{x^2}\right)} &= \frac{a}{x} + \frac{b}{x^2} - \frac12 \left ( \frac{a}{x} + \frac{b}{x^2} \right )^2 + O\left(\frac{1}{x^3}\right)\\ &=  \frac{a}{x} + \frac{b}{x^2} - \frac{a^2}{2 x^2} - \frac{a b}{x^3} - \frac{b^2}{2 x^4}+ O\left(\frac{1}{x^3}\right)\\ &= \frac{a}{x} + \frac{b}{x^2} - \frac{a^2}{2 x^2} + O\left(\frac{1}{x^3}\right) \end{align}$$
A: Alternative method:
The given limit is of the form : $ 1^\infty$
In general any limit of the form $ 1^\infty$ can be evaluated using the following theorem.
The statement is ::
$  if \lim\limits_{x\to a}{f(x)}^{g(x)}\ is\ of\ the\  form\ 1^\infty, $
$ the\ limit\ is\ equal\ to\  e^{\lim\limits_{x\to a}{(f(x)-1)*g(x)}} $
here $ f(x)\ is\ 1+\frac{a}{x}+\frac{b}{x^2} $ and $ g(x)\ is\ {2x} $.
Substituting in the above expression, the limit is 
$ e^{{\lim\limits_{x\to \infty}}{(1+\frac{a}{x}+\frac{b}{x^2}-1)}{2x}} $
that is,
$ e^{{\lim\limits_{x\to \infty}}{(\frac{a}{x}+\frac{b}{x^2})}{2x}} $
then,
$ e^{{\lim\limits_{x\to \infty}}{({2a}+\frac{2b}{x})}} $
which finally is, 
$ e^{2a}=e^2 $
which gives us a=1;
b is any real number and is immaterial. 
