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?

Or we can immediately simplify things:
$$\begin{aligned}\lim_{x\to 1}(1-x)\tan\left(\frac\pi2 x\right)&=\lim_{x\to 1}\frac{1-x}{\cot\left(\frac\pi2 x\right)}\\&=\lim_{x\to 1}\frac{1-x}{\tan\left(\frac\pi2(1-x)\right)}\\&=\frac2\pi\lim_{x\to 1}\frac{\frac\pi2(1-x)}{\tan\left(\frac\pi2(1-x)\right)}\\&=\frac2\pi\end{aligned}$$
relying on the manual limit $\lim\limits_{x\to 0}\frac{\tan x}x=1$.
