# Verify $\cos(x)=\frac{1-t^2}{1+t^2}$ with $t=\tan(\frac{x}{2})$

I was requested to verify, with $$t=\tan(\frac{x}{2})$$, the following identity:

$$\cos(x)=\frac{1-t^2}{1+t^2}$$

I'm quite rusty on my trigonometry, and hasn't been able to found the proof of this. I'm sure there may be some trigonometric property I should know to simplify the work. Could someone hint me or altotegher tell me how to solve this problem? I tried to simplify the RHS looking to get $$\cos(x)$$ out of it but failed.

Write $$y=x/2$$. Then, multiplying by $$\cos^2y$$ on top and bottom, $$\frac{1-\tan^2y}{1+\tan^2y}=\frac{\cos^2y-\sin^2y}{\cos^2y+\sin^2y}=\frac{\cos2y}1=\cos x$$ The denominator simplifies by the Pythagorean identity $$\cos^2x+\sin^2x=1$$ and the numerator simplifies by $$\cos2x=\cos^2x-\sin^2x$$.
$$\cos(x)=\cos^2(x/2)-\sin^2(x/2)=(1-t^2)/(\sec^2(x/2))=(1-t^2)/(1+t^2)$$
Remember the high-school identities: $$\;1+\tan ^2\theta=\frac1{\cos^2\theta}\;$$ and $$\;\cos2\theta=\cos^2\theta-\sin^2\theta$$:
$$\frac{1-\tan^2\frac x 2}{1+\tan^2\frac x 2}=\cos^2\tfrac x2\bigl(1-\tan^2\tfrac x 2\bigr)=\cos^2\tfrac x2-\sin^2\tfrac x2=\cos x.$$