How did they get this result? Please, explain these computations:
1) $-\left(\frac{1}{2}\right)^2 +1 =  \cos^2x$
$\frac{\sqrt{3}}{2}  =  \cos x$
How did we get  $\frac{\sqrt{3}}{2}$   from   $-\left(\frac{1}{2}\right)^2 +1$?
2) $-\left(\frac{\sqrt{2}}{2}\right)^2 +1 = \cos^2x$
$\frac{\sqrt{2}}{2} = \cos x$
How did we get $ \frac{\sqrt{2}}{2}$   from  $-\left(\frac{\sqrt{2}}{2}\right)^2 +1 $?

You have:


*

*$$\cos^2 x = -(\frac{1}{2})^2 + 1$$
$$\cos^2 x = -\frac{1}{4} + 1=\frac{3}{4}$$
Which is:
$$\sqrt \cos^2 x = \sqrt \frac{3}{4}$$
$$\cos x = \pm \frac{\sqrt 3}{2}$$
Same works for the second one.
