I met a question, let me compute $$ \lim\limits_{x\to 0}(\cos x)^{-x^2}$$
the answer is 1
this is not a primary function, its structure is like $$\lim\limits_{x\to 0}f(x)^{g(x)}$$
is it a theorem, which I don't find it on my math book? probably write as $$\lim\limits_{x\to a}f(x)^{g(x)} = [\lim\limits_{x\to a}f(x)]^{\lim\limits_{x\to a}g(x)}$$
When $ \lim_{x\to a}f(x) > 0$ and $\lim_{x\to a} g(x)$ exsits, from the continuity of $\exp(x)$ and $\ln(x)$, we have $$ \lim_{x\to a} f(x)^{g(x)} = \lim_{x\to a} \exp({g(x)\cdot \ln f(x)}) = \exp \left(\lim_{x\to a} g(x) \cdot \ln \left(\lim_{x\to a}f(x)\right)\right) = \left[\lim_{x\to a}f(x)\right]^{\lim_{x\to a} g(x)} .$$