To calculate the value of the function cosine, we'll apply the fundamental formula of trigonometry:

(sin x)^2 + (cos x)^2 = 1

cos x = sqrt [1-(sin x)^2]

cos x = sqrt (1 - 1/4), but sin x = 1/2

cos x = sqrt[(4-1)/4]

cos x = (sqrt3)/2 , if x is in the first quadrant, namely x belongs to the interval (0, pi/2).

cos x = -(sqrt3)/2, if x is in the second quadrant, namely x belongs to the interval (pi/2, pi).

sinx = 1/2

To find cosx.

sinx = 1/2. But (sinx)^2+(cosx)^2 = 1 is a trigonometric identity.

So (cosx)^2 = 1-(sinx)^2. Put sinx = 1/2. the given value.

(cosx)^2 = 1-(1/2)^2 = 1-1/4 = 3/4.

(cosx)^2 = 3/4.

Take square root.

cosx = + or -sqrt(3/4).

So When sinx = 1/2 both 1st or second quadrant ,

Cosx = (sqrt 3)/2 in first quadrant

cosx = -(sqrt3)/2 in 2nd quadrant

Here we can use the relation (sin x)^2+ (cos x)^2=1.

As sin x=1/2, (sin x)^2= 1/4.

(cos x)^2=1-1/4=3/4

Therefore cos x= +sqrt(3)/2 or -sqrt(3)/2

The two values correspond to x being in the first or the second quadrant resp.