Evaluate $$\lim_{x\to \frac\pi2} \frac{2^{-\cos x}-1}{x-\frac\pi2}$$
$$$$ My approach: $$$$ Substituting $x-\pi/2=u$, $$\lim_{x\to \frac\pi2} \frac{2^{-\cos x}-1}{x-\frac\pi2}=\lim_{u\to 0} \frac{2^{\sin u}-1}{u}$$ $$$$ Here I noticed the similarity of the limit with the known limit $\lim_{u\to 0} \frac{a^{u}-1}{u}=\ln(a)$ $$$$In the above limit if we plugged in $u=0$ directly, we would get the following indeterminate form: $$\lim_{u\to 0} \frac{a^{u}-1}{u}=\frac{a^{0}-1}{0}=\frac{1-1}{0}=\frac{0}{0}$$
Now if we put $u=0$ in $\lim_{u\to 0} \frac{2^{\sin u}-1}{u}$ we once again get $$\lim_{u\to 0} \frac{2^{\sin u}-1}{u}=\frac{2^{0}-1}{0}=\frac{1-1}{0}=\frac{0}{0}$$ $$$$This similarity made me wonder if I could use the result $$\lim_{u\to 0} \frac{a^{u}-1}{u}=\ln(a)$$ in the case of $$\lim_{u\to 0} \frac{2^{\sin u}-1}{u}$$
And indeed on using the result, I got the correct answer: $\ln(2)$.$$$$ However I'm not sure if and why the method is mathematically correct. Or if this method that I have used just happens to work in this case. $$$$The reason is as follows:$$$$ In the limit $\lim_{x\to 0} \frac{a^{x}-1}{x}=\ln(a)$ the power to which $a$ is raised is the same as the term in the denominator. $$$$ Likewise if I had made the substitution $x=\sin u$, then the limit would become $\lim_{\sin u\to 0} \frac{a^{\sin u}-1}{\sin u}=\ln(a)$, and then the power to which $a$ is raised is the same as the term in the denominator. However in the limit $$\lim_{u\to 0} \frac{2^{\sin u}-1}{u}$$ the power to which $2$ is raised $isn't$ the same as the term in the denominator. Thus this limit seems to be a 'hybrid' to which I'm applying the known result for a 'pure limit' (as in one where the power to which $a$ is raised is the same as the term in the denominator).
$$$$Under these circumstances is the method I have used correct? If so, then when can we use this method where $x\to k$ implies $f(x)\to l$, thus making some formula about limits valid, in the way $\lim_{u\to 0} \frac{2^{\sin u}-1}{u}=\ln(2)$ seems to be valid as $x\to 0$ implies $f(x)=\sin x\to 0$ ? $$$$I would be truly grateful for any help. Many many thanks in advance!
Edit: In short, could somebody please explain $why$ the formula I've used is correct, despite, the power to which 2 is raised ($\sin u$) being different from the term in the denominator (u), and also the condition of the limit being $u\to 0$ whilst the power to which 2 is raised is $\sin u$ and not $u$.? In other words, is it correct to use the formula $$\lim_{u\to 0} \dfrac{2^{\sin u}-1}{u}=\ln(2)$$ merely because $u\to 0$ implies$$\sin u\to 0\Rightarrow 2^{\sin u}\to 1$$, which is essentially what is happening in the limit $\lim_{u\to 0} \frac{a^{u}-1}{u}=\ln(a):u\to\Rightarrow a^u\to 0$