<s>[INST] Converting $\cos\phi$ into $\frac{1−t^2}{1+t^2}$, given that $t = \tan\frac{\phi}{2}$ 
I have to figure out the working to convert $\cos\phi$ into $\dfrac{1−t^2}{1+t^2}$, given that $t = \tan\dfrac{\phi}{2}$.

It would be amazing if someone could help I've been trying to do it for hours.
 [/INST] If $t = \tan \frac \phi 2$, then by drawing a right triangle, one can see that $$\sin \frac \phi 2 = \frac{t}{\sqrt{t^2+1}} \quad \text{ and } \quad \cos \frac \phi 2 = \frac{1}{\sqrt{t^2+1}}$$
So, by using $\cos (2x) = 1 - 2 \sin^2x$ and letting $x = \frac \phi 2$, we get
$$\cos \phi = 1 - 2 \cdot \left(\frac{t}{\sqrt{t^2+1}}\right)^2 = 1-\frac{2t^2}{t^2+1} = \frac{1-t^2}{1+t^2}$$
</s>