If $z = \tan(x/2)$, what is $\sin(x)$ and $\cos(x)$? While reading mathematical gazette, I noticed an interesting "theorem". If $z = \tan(x/2)$, then $\sin(x) = \frac{2z}{1+z^2}$ and $\cos(x) = \frac{1-z^2}{1+z^2}$.
How can I derive these so I don't have to remember them?

\begin{align}
z & = \tan \frac x 2 & & \frac z 1 = \tan = \frac{\text{opposite}}{\text{adjacent}} \\[10pt]
x & = 2\arctan z \\[10pt]
\sin x & = \sin(2\arctan z) \\
& = \sin(2\theta) = 2\sin\theta\cos\theta \\[10pt]
& = 2\sin(\arctan z)\cos(\arctan z) \\[10pt]
& = 2 \frac{\text{opposite}}{\text{hypotenuse}} \cdot \frac{\text{adjacent}}{\text{hypotenuse}} \\[10pt]
&  = 2\frac{z}{\sqrt{1+z^2}} \cdot\frac{1}{\sqrt{1+z^2}} \\[12pt]
& = \frac{2z}{1+z^2}.
\end{align}
The fact that $\text{hypotenuse} = \sqrt{1+z^2}$ comes from the Pythagorean theorem. And $\cos x$ is handled similarly.
