<s>[INST] Simplify using the Tangent Difference identity I solved a problem to the point that I know the answer is 
$$\frac{2nr}{\tan\left( \frac{(n-2)\pi}{2n} \right)}$$
The question tells me that the answer is going to be 
$$2rn\tan\left(\frac{\pi}{n}\right)$$
Wolfram Alpha tells me the two are equal, so at least I'm on the right track. [link]
I was able to simplify 
$$\frac{2nr}{\tan\left( \frac{(n-2)\pi}{2n} \right)}$$ to $$\frac{2nr}{\tan\left( \frac{\pi}{2} - \frac{\pi}{n} \right)}$$
and then attempted to use the tangent difference identify, 
$$\tan(\alpha \pm \beta) = \frac{\tan\alpha \pm \tan\beta}{1 \mp \tan\alpha\tan\beta}$$
to simplify further.
But I am unable to find $\tan\alpha$ due to the fact that $\tan\left(\frac{\pi}{2}\right)$ is undefined. How do I work around this?
(Sorry if I went overboard with my LaTeX, I was really excited to be able to use it.)
 [/INST] First, as you note: 
$$\tan\left(\frac{(n-2)\pi}{2n}\right) = \tan\left(\frac{\pi}{2}-\frac{\pi}{n}\right) =- \tan\left(\frac{\pi}{n}-\frac{\pi}{2}\right).$$
Now remember that $\sin\left(a - \frac{\pi}{2}\right) = -\cos(a)$ and $\cos\left(a - \frac{\pi}{2}\right) = \sin(a)$. So:
$$\begin{align*}
\tan\left(\frac{(n-2)\pi}{2n}\right) &= -\tan\left(\frac{\pi}{n}-\frac{\pi}{2}\right)\\
&= -\frac{\sin\left(\frac{\pi}{n}-\frac{\pi}{2}\right)}{\cos\left(\frac{\pi}{n}-\frac{\pi}{2}\right)}\\
&= -\frac{-\cos\frac{\pi}{n}}{\sin\frac{\pi}{n}}\\
&= \cot\frac{\pi}{n}.
\end{align*}$$
Therefore,
$$\frac{2nr}{\tan\left(\frac{(n-2)\pi}{2n}\right)} = \frac{2nr}{\cot\frac{\pi}{n}} = 2nr\tan\frac{\pi}{n}.$$
</s>