Part 1
#sqrt((1-cosx)/(1+cosx))#
#color(white)("XXX")=sqrt(1-cosx)/sqrt(1+cosx)#
#color(white)("XXX")=sqrt((1-cosx))/sqrt(1+cosx) * sqrt(1-cosx)/sqrt(1-cosx)#
#color(white)("XXX")=(1-cosx)/sqrt(1-cos^2x)#
Part 2
Similarly
#sqrt((1+cosx)/(1-cosx)#
#color(white)("XXX")=(1+cosx)/sqrt(1-cos^2x)#
Part 3: Combining the terms
#sqrt((1-cosx)/(1+cosx))+sqrt((1+cosx)/(1-cosx)#
#color(white)("XXX")=(1-cosx)/sqrt(1-cos^2x)+(1+cosx)/sqrt(1-cos^2x)#
#color(white)("XXX")=2/sqrt(1-cos^2x)#
#color(white)("XXXXXX")#and since #sin^2x+cos^2x=1# (based on the Pythagorean Theorem)
#color(white)("XXXXXXXXX")sin^2x=1-cos^2x#
#color(white)("XXXXXXXXX")sqrt(1-cos^2x)=abs(sinx)#
#sqrt((1-cosx)/(1+cosx))+sqrt((1+cosx)/(1-cosx))=2/sqrt(1-cos^2x)=2/abs(sinx)#