Expressing $\cos(x)$ and $\sin(x)$ in terms of $\tan(\frac{1}{2} x)$ May I know is there any quick way to express $\cos(x)$ and $\sin(x)$ in terms of $\tan(\frac{1}{2} x)$. I checked that $\cos(x)=\frac{1 - \tan^2(\frac{1}{2} x)}{1+\tan^2(\frac{1}{2} x)}$. I really want to know how could I figure this out quickly, as well as how can I express $\sin(x)$ in terms of $\tan(\frac{1}{2} x)$ .
 Thank you very much for your help. 

For the sine, you have
$$\begin{align}
\sin x&=2\sin\frac x2\cos \frac x2 \\
&= \frac{2\frac{\sin \frac x2}{\cos \frac x2}}{\frac{1}{\cos^2 \frac x2}} \\
&= \frac{2\tan\frac x2}{1+\tan^2\frac x2}\\
\end{align}
$$
In the second line, we divide the numerator and denominator ($=1$) by $\cos^2\frac x2$, and we then use $1+\tan^2\frac x2=\frac{1}{\cos^2\frac x2}$
