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?

$L=\lim\limits_{x \to 1}((1 - x)\tan \frac{\pi x}{2})$
$L=\lim\limits_{(x-1) \to 0}((1 - x)\cot(\frac{\pi }{2}- \frac{\pi x}{2}))$
$L=\frac{2 }{\pi}\lim\limits_{\frac{\pi }{2}(x-1) \to 0}(\frac{\pi }{2}(1 - x)(-)\frac{cos\frac{\pi }{2}(x- 1)}{sin\frac{\pi }{2}(x- 1)})$
$L=\frac{2 }{\pi}\lim\limits_{\frac{\pi }{2}(x-1) \to 0}(\frac{\pi }{2}(x - 1)\frac{cos\frac{\pi }{2}(x- 1)}{sin\frac{\pi }{2}(x- 1)})$
$L=\frac{2 }{\pi}\lim\limits_{\frac{\pi }{2}(x-1) \to 0}\frac{1}{1}$
$L=\frac{2 }{\pi}$
