\cos x=\frac{1-\tan^2 {\frac{x}{2}}}{1+\tan^2 {\frac{x}{2}}