<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] $$\lim _{ x\to a } \left( 2-\frac { x }{ a }  \right) ^{ \tan  \left( \frac { \pi x }{ 2a }  \right)  }=\lim _{ x\to a }{ \left[ { \left( 1+\left( 1-\frac { x }{ a }  \right)  \right)  }^{ \frac { a }{ a-x }  } \right]  } ^{ \frac { a-x }{ a } \tan  \left( \frac { \pi x }{ 2a }  \right)  }=\\ ={ e }^{ \lim _{ x\rightarrow a }{ \frac { a-x }{ a } \tan  \left( \frac { \pi x }{ 2a }  \right)  }  }={ e }^{ \lim _{ x\rightarrow a }{ \frac { a-x }{ a\cot { \left( \frac { \pi x }{ 2a }  \right)  }  }  }  }\overset { L'Hospital }{ = } { e }^{ \lim _{ x\rightarrow a }{ \frac { -1 }{ -a\frac { 1 }{ \sin ^{ 2 }{ \left( \frac { \pi x }{ 2a }  \right)  }  } \left( \frac { \pi  }{ 2a }  \right)  }  }  }=\color{blue}{{ e }^{ \frac { 2 }{ \pi  }  }}$$
</s>