<s>[INST] How to solve $\lim_{x\rightarrow a} (2-\frac{x}{a})^{\tan (\frac{\pi x}{2a})}$ Can someone help me to calculate the following limit?
$$\lim_{x\to a} \Big(2-\frac{x}{a}\Big)^{\tan\dfrac{\pi x}{2a}}$$
Thank you.
 [/INST] Consider $\lim_{x\rightarrow a} e^{\ln((2-\frac{x}{a})^{\tan (\frac{\pi x}{2a})})}=\lim_{x\rightarrow a} e^{\tan(\frac{\pi x}{2a})\ln(2-\frac{x}{a})}$.
Clearly it suffices to calculate the limit $$\lim_{x\rightarrow a} {\tan(\frac{\pi x}{2a})\ln(2-\frac{x}{a})}.$$
We can do this by using L'Hopitals rule.
\begin{eqnarray}
\lim_{x\rightarrow a} {\tan(\frac{\pi x}{2a})\ln(2-\frac{x}{a})} 
&=& \lim_{x\rightarrow a} \frac{\sin(\frac{\pi x}{2a})\ln(2-\frac{x}{a})}{\cos(\frac{\pi x}{2a})}\\
& \overset{\mathrm{H}}{=}& \lim_{x\rightarrow a} \frac{\frac{\pi}{2a}\cos(\frac{\pi x}{2a})\ln(2-\frac{x}{a})-\frac{1}{a}\frac{1}{2-\frac{x}{a}}\sin(\frac{\pi x}{2a})}{-\frac{\pi}{2a}\sin(\frac{\pi x}{2a})}\\
&=& \frac{2}{\pi}.
\end{eqnarray}
Hence the desired limit is $e^{\frac{2}{\pi}}$.
</s>