<s>[INST] What am I doing wrong finding $\lim_{x\to 0} \left( \frac{1+x\cdot2^x}{1+x\cdot3^x} \right)^{1/x^2}$? It has an answer here, but I'd like to know where my solution went wrong.
$$\lim_{x\to 0} \left( \frac{1+x\cdot2^x}{1+x\cdot3^x} \right)^{\frac{1}{x^2}} $$
$$\lim_{x\to 0} \left( \frac{1+x\cdot2^x +x\cdot 3^x-x\cdot 3^x}{1+x\cdot3^x} \right)^\frac{1}{x^2} $$
$$\lim_{x\to 0} \left( 1 + \frac{x\cdot2^x-x\cdot 3^x}{1+x\cdot3^x} \right)^\frac{1}{x^2} $$
$$\lim_{x\to 0} \left( 1 + \frac{x\cdot2^x-x\cdot 3^x}{1+x\cdot3^x} \right)^{\frac{1}{x^2}\cdot \frac{1+x\cdot 3^x}{x\cdot2^x-x\cdot 3^x}\cdot\frac{x\cdot2^x-x\cdot 3^x}{1+x\cdot3^x}} $$
$$\lim_{x\to 0}  e^{\frac{1}{x^2}\cdot \frac{x\cdot2^x-x\cdot 3^x}{1+x\cdot3^x}} $$
$$\lim_{x\to 0}  e^{\frac{1}{x}\cdot \frac{2^x-3^x}{1+x\cdot3^x}} $$
$$\lim_{x\to 0}  e^{\frac{1}{x}\cdot \frac{(1+1)^x-(2+1)^x}{1+x\cdot3^x}} $$
$$\lim_{x\to 0}  e^{\frac{1}{x}\cdot \frac{1+x+o(x)-1-x2-o(x)}{1+x\cdot3^x}} $$
$$\lim_{x\to 0}  e^{\frac{-1}{1+x\cdot3^x}} $$
$$e^{-1}$$
The answer in the book is $\frac{2}{3}$.
 [/INST] You have used binomial theorem to expand $2^x$ and $3^x$ and this is not valid as the binomial theorem for a general exponent is valid only under certain conditions. To be precise you have $$(1+t)^x=\sum_{k=0}^{\infty}\binom{x}{k}t^k$$ for $|t|<1$. The result is valid for $t=\pm 1$ with certain restrictions on $x$. For details see this blog post.
But in any case it is not valid for $t=2$ and thus can't be used to expand $3^x$. Also when the binomial expansion is valid we have $$(1+t)^x=1+xt+o(t)$$ and not $$(1+t)^x=1+xt+o(x)$$ The right approach for your problem is to use the standard limit $$\lim_{x\to 0}\frac{a^x-1}{x}=\log a$$ and thus we get $$\lim_{x\to 0}\frac{2^x-3^x}{x(1+x3^x)}=\lim_{x\to 0}\frac{2^x-1}{x}-\frac{3^x-1}{x}=\log 2-\log 3=\log(2/3)$$ and the desired limit is $e^{\log(2/3)}=2/3$.
Also you can split limit operations into base and exponent under certain conditions but it is much simpler to take logs rather than remembering the conditions under which one can split limit operations. 
</s>