Where to take square root "positive, negative" and where to take it only "positive"??

I wrote in my Notebook a few days ago..

cos(x)= [1-sin^(2)x]^(1/2) {derived from "cos^(2)x + sin^(2)x = 1 ")

But the teacher said i was wrong cuz i shoud have written it like this....

cos(x)= +[1-sin^(2)x]^(1/2) , cos(x)= -[1-sin^(2)x]^(1/2)

__________________________________________________ ___

Today we came across an equation

y= cos(x)

and the teacher wrote..

y= [cos^(2)x]^1/2

and then he wrote...

y= [1-sin^(2)x]^(1/2) (since cos^(2)x= 1 - sin^(2)x)

now im really confused....i dont know where to take square root positive and where to take it both positive and negative at the same time.

Please explain your answer by providing the rules....so that i may use your concept in other kind of functions aswell