<s>[INST] knowing: $ \tan x=2-\sqrt{3}$ , obtain: $ \cos 2x$ 
Knowing: $$ \tan x=2-\sqrt{3} $$
Obtain: $$\cos2x$$

I tried converting $\tan x$ into it's sinus and cosine form and trying to square both sides to try to get the form of:
$$\cos^2x-\sin^2x$$
But I can't really get to this form without having extra expressions of sine or cosine, any ideas how to start this properly?
Taken out of one of the entry tests to Maths in TAU.
Solution:
$$\cos2x=\cos^2x-\sin^2x=\frac{\cos^2x-\sin^2x}{\sin^2x+\cos^2x}:\frac{\cos^2x}{\cos^2x}=\frac{1-\tan^2x}{1+\tan^2x}$$
$$ \frac{1-\tan^2x}{1+\tan^2x}=\frac{-6+4\sqrt{3}}{8-4\sqrt{3}}=\frac{-3+2\sqrt{3}}{4-2\sqrt{3}} $$
 [/INST] Draw a right triangle with the opposite side being $2 - \sqrt3$, and the adjacent side being $1$ so that $\tan x = 2 - \sqrt{3}$. Then the hypotenuse is $\sqrt{1^2 + (2 - \sqrt{3})^2} = \sqrt{1 + 4 - 4\sqrt3 + 3} = \sqrt{8 - 4 \sqrt{3}}$, and so $\cos^2 x = \frac{1}{8 - 4 \sqrt{3}}$ as $\cos x$ is adjacent/hypotenuse.
Now $\cos 2x = 2 \cos^2 x - 1$, which is $\frac{1}{4 - 2 \sqrt3} - 1$ or $\frac{4 + 2 \sqrt3}{4} - \frac{4}{4} = \frac{\sqrt 3}{2}$.
</s>