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