<s>[INST] 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?
 [/INST] $$\frac{2\tan(x/2)}{1+ \tan^2(x/2)} = \frac{2\tan(x/2)}{\sec^2(x/2)} = 2\tan(x/2) \cdot \cos^2(x/2) = 2\sin(x/2)\cos(x/2) = \sin(2\cdot x/2) = \sin(x)$$
$$\frac{1- \tan^2(x/2)}{1+ \tan^2(x/2)} = \frac{1- \tan^2(x/2)}{\sec^2(x/2)} = 1- \tan^2(x/2) \cdot \cos^2(x/2) = \cos^2(x/2) - \sin^2(x/2) = \cos(2 \cdot x/2) = \cos(x)$$
</s>