<s>[INST] Calculate $\lim_{x\to a}(2-\frac{x}{a} )^{\tan( \frac{\pi x}{2a})}$ 
I would like to calculate 
  $$\lim\limits_{x\to a}\left(2-\dfrac{x}{a} \right)^{\tan\left( \dfrac{\pi x}{2a}\right)},\quad a \in\mathbb{R}^* \,\,\text{fixed} $$

we've 
$$\left(2-\dfrac{x}{a} \right)^{\tan\left( \dfrac{\pi x}{2a}\right)}=e^{\tan\left( \dfrac{\pi x}{2a}\right)\ln\left(2-\dfrac{x}{a} \right)}.$$
Note that:
$$\ln\left(2-\dfrac{x}{a} \right)\sim_{a}1-\dfrac{x}{2}.$$
Now we have $\dfrac{\pi x}{2a}\underset{x\to a}{\longrightarrow} \dfrac{\pi}{2}$, i.e.$\dfrac{\pi x}{2a}-\dfrac{\pi}{2}  \underset{x\to a}{\longrightarrow} 0$ and $\tan h \sim_{0}h.$
I'm stuck.
Update: here is another way :
\begin{aligned}
\left(2-\dfrac{x}{a} \right)^{\tan\left( \dfrac{\pi x}{2a}\right)}&=\exp\left[{\tan\left( \dfrac{\pi x}{2a}\right)\ln\left(2-\dfrac{x}{a} \right)}\right].\\
&=\exp\left[ \left(1-\dfrac{x}{a}\right)\tan\left(\dfrac{\pi x}{2a}-\dfrac{\pi}{2}+\dfrac{\pi}{2} \right).\dfrac{\ln\left(2-\dfrac{x}{a} \right)}{1-\dfrac{x}{a}}\right]\\
&=\exp\left[ -\dfrac{\left(1-\dfrac{x}{a} \right)}{\tan\left(\dfrac{\pi x}{2a}-\dfrac{\pi}{2} \right)}.\dfrac{\ln\left(2-\dfrac{x}{a} \right)}{\left(1-\dfrac{x}{a}\right)}\right]\\
&=\exp\left[ -\dfrac{\left(1-\dfrac{x}{a} \right)}{\tan\left(-\dfrac{\pi}{2}\left(1-\dfrac{x}{a} \right)\right)}.\dfrac{\ln\left(2-\dfrac{x}{a} \right)}{\left(1-\dfrac{x}{a}\right)}\right]\\
&=\exp\left[ \dfrac{2}{\pi} \dfrac{\dfrac{\pi}{2}\left(1-\dfrac{x}{a} \right)}{\tan\left(\dfrac{\pi}{2}\left(1-\dfrac{x}{a} \right)\right)}.\dfrac{\ln\left(2-\dfrac{x}{a} \right)}{\left(1-\dfrac{x}{a}\right)}\right]\\
\end{aligned}
Thus 
$$\lim\limits_{x\to a}\left(2-\dfrac{x}{a} \right)^{\tan\left(\dfrac{\pi x}{2a}\right)}  =e^{\dfrac{2}{\pi}} $$


*

*Am i right beside i'm intersted in way which use equivalents

 [/INST] $$A=\left(2-\frac{x}{a} \right)^{\tan( \frac{\pi x}{2a})}\implies \log(A)=\tan( \frac{\pi x}{2a})\log\left(2-\frac{x}{a} \right)$$ Now, using Taylor expansion around $x=a$
$$\log\left(2-\frac{x}{a} \right)=-\frac{x-a}{a}-\frac{(x-a)^2}{2 a^2}+O\left((x-a)^3\right)$$ Using Laurent expansion around $x=a$
$$\tan( \frac{\pi x}{2a})=-\frac{2 a}{\pi  (x-a)}+\frac{\pi  (x-a)}{6 a}+O\left((x-a)^3\right)$$ Combining the product
$$\log(A)=\frac{2}{\pi }+\frac{x-a}{\pi  a}+O\left((x-a)^2\right)$$ Taylor again  $$A=e^{\log(A)}=e^{\frac{2}{\pi }}\left(1+\frac{x-a}{\pi  a}+O\left((x-a)^2\right)\right)$$ which shows the limit and also how it is approached.
</s>