<s>[INST] Complex number problem $i \tan (\theta)$ proof. 
Given $z = \cos (\theta) + i \sin (\theta)$, 
  prove $\dfrac{z^{2}-1}{z^{2}+1} = i \tan(\theta)$

I know $|z|=1$ so its locus is a circle of radius $1$; and so $z^{2}$ is also on the circle but with argument $2\theta$; and $z^{2}+1$ has argument $\theta$ (isosceles triangle) so it lies on a line through the origin and $z$.
$z^{2}-1$, $z^{2}$, and $z^{2}-1$ all lie on a horizontal line $i \sin (\theta)$.
On the Argand diagram I can show $z^{2}+1$ and $z^{2}-1$ are perpendicular so the result follows.
Can anyone give an algebraic proof?
 [/INST] For $z = \cos \theta + i \sin \theta$ you have
$$
 \frac{z^2-1}{z^2+1} = \frac{ \cos^2 \theta - \sin^2 \theta + 2i \cos\theta \sin \theta -1}{\cos^2 \theta - \sin^2 \theta + 2i \cos\theta \sin \theta +1 } \, .
$$
Now substitute $1 = \cos^2 \theta + \sin^2 \theta $ in both numerator and denominator, and collect terms:
$$
\frac{-2 \sin^2 \theta + 2 i \cos\theta \sin\theta}{2 \cos^2\theta + 2 i \cos\theta \sin\theta} = 
\frac{- \sin\theta + i \cos \theta}{\cos \theta + i \sin\theta} \cdot \frac{\sin\theta }{\cos\theta}  \, .
$$
Finally convince yourself that the first factor is equal to $i$, and
you are done.
</s>