Find the value of $\sqrt{\left(\cos\theta\right)^2}$ at $\theta=\pi$
There can be two ways in which people will do this:
First way: Put the value of theta directly, so $\sqrt{\left(\cos\pi\right)^2}$, answer will be $1$
Second way: Simplify the expression first and then put the value of $\theta$, so in this case one will get $-1$.
Why do these two ways give different answers?