Why do you need absolute value when taking $\sqrt{\cos^2(x)}$ $$\sqrt{\cos^2(x)} = |\cos(x)|$$

Is this on the right track?  If you have an underlying $\cos(x)$ that is negative, and then you square it, you will now have $\cos^2{x}$, which is positive.  But, if you now square root that positive squared term, you will just have a positive value of the $\cos(x)$, which is not what you started with?
As $(-t)^2 = t^2$, the square root doesn't know which is the sign of the thing-inside-the-square.
As $(-t)^2 = t^2$, the square root doesn't know which is the sign of the thing-inside-the-square.