Use trig identities: #2sin^2x = 1 - cos 2x# #2cos^2 x = 1 + cos 2x#
In this case: #tan (x/2) = sin (x/2)/(cos (x/2)#
Find #sin (x/2)# and #cos (x/2)# in terms of cos x. #sin^2 (x/2) = (1 - cos x)/2# --> #sin (x/2) = +- sqrt((1 - cos x))/(sqrt2)#.
#cos^2 (x/2) = (1 + cos x)/2#. #cos (x/2) = +- sqrt((1 + cos x)/(sqrt2)#. #tan (x/2) = sqrt((1 - cos x)/(1 + cos x))#.