But doesn't the squre inside the squareroot eliminate any possible negative values derived from cos, hence shouldn't squareroot of (square of cosx) be just cosx!
I know the solution above by you is correct, but just finding it difficult to understand the concept behind it.
example...