calculate $\lim\limits_{x \to 1}(1 - x)\tan \frac{\pi x}{2}$ I need to calculate $$\lim_{x \to 1}\left((1 - x)\tan \frac{\pi x}{2}\right)$$.
I used MacLaurin for $\tan$ and got $\frac{\pi x} {2} + o(x)$. Then the full expression comes to $$\lim_{x \to 1}\left(\frac {\pi x} {2} - \frac {\pi x^2} {2} + o(x)\right) = 0$$But WolframAlpha says it should be $\frac 2 \pi$. What am I doing wrong?

You can rewrite $(1-x)\tan(\frac{\pi x}{2})$ as $\frac{1-x}{\cot(\frac{\pi x}{2})}$. Then you can use L'Hopitals rule to say that $\lim \limits_{x \to 1}\frac{1-x}{\cot(\frac{\pi x}{2})}=\lim \limits_{x \to 1}\frac{-1}{-\frac{\pi}{2} \csc^2(\frac{\pi x}{2})}=\frac{2}{\pi}$
