Find the limit of the complex function. $$ \lim_{x\to a} \left(2- \frac{x}{a}\right)^{\left(\tan \frac{\pi x}{2a}\right)}.$$
I have simplified this limit to this extent :
$$e^{ \lim_{x\to a} \left(\left(1- \frac{x}{a}\right){\left(\tan \frac{\pi x}{2a}\right)}\right)}$$
I don't know how to simplify the limit after that. please help.

$$ \lim_{x\to a} \left(2- \frac{x}{a}\right)^{\tan \frac{\pi x}{2a}}= \lim_{x\to a} \left(1+1- \frac{x}{a}\right)^{\frac{1}{1-\frac{x}{a}}\cdot\left(1-\frac{x}{a}\right)\tan \frac{\pi x-\pi a+\pi a}{2a}}=$$
$$=e^{\frac{2}{\pi}\lim\limits_{x\rightarrow a}\left(\frac{\frac{\pi}{2a}(a-x)}{\sin\frac{\pi}{2a}(a-x)}\cdot\cos\frac{\pi}{2a}(a-x)\right)}=e^{\frac{2}{\pi}}.$$
