<s>[INST] Finding limit $\ \lim_{x \to 2} \frac{\cos \frac{\pi}{x}}{x-2}$ without l'hopital's Find limit of

$$\ \lim_{x \to 2} \frac{\cos \frac{\pi}{x}}{x-2} $$

by using $\ t = \frac{\pi}{2} - \frac{\pi}{x} $
$$\ \lim_{x \to 2} \frac{\cos \frac{\pi}{x}}{x-2} = \lim_{t \to 0} \frac{\cos( \frac{\pi}{2}-t)}{-\frac{\pi}{t}} = \lim_{t \to 0} -\frac{t \cdot \cos(\frac{\pi}{2} - t)}{\pi} = \frac{0 \cdot \cos \frac{\pi}{2}}{\pi} = \frac{0}{\pi}$$
Not sure what am I missing here as the correct answer is $\ \frac{\pi}{4} $ according to wolframalpha.This is exactly the same question, yet even using the way suggested there I didn't get to the answer.
Please if you can show solution using the $\ t$ value I gave here and trig identities. I guess there are other ways using l'hopital's rule or something but that's not my intent.
 [/INST] We have that by $x=y+2\,$ with $\,y \to 0$
$$\lim_{x \to 2} \frac{\cos \frac{\pi}{x}}{x-2}=\lim_{y \to 0} \frac{\cos \frac{\pi}{y+2}}{y}=\lim_{y \to 0} \frac{\sin\left( \frac{\pi}{2}-\frac{\pi}{y+2}\right)}{y}=\lim_{y \to 0} \frac{\sin\left( \frac{\pi y }{2(y+2)}\right)}{y}=$$$$=\lim_{y \to 0} \frac{\sin\left( \frac{\pi y }{2(y+2)}\right)}{ \frac{\pi y }{2(y+2)}}\frac{\pi  }{2(y+2)}=1\cdot \frac{\pi}4=\frac{\pi}4$$
</s>