Let us begin with #cos (theta/2)#
#cos (theta/2)=sqrt((1+cos theta)/2)# Half-angle formula
Next, the #Sec (theta/2)# is the reciprocal of #cos (theta/2)#
That #sec (theta/2)=sqrt(2/(1+cos theta))#
Next, the #tan (theta/4)# can be expressed using sine and cosine:
#tan (theta/4)=sqrt((1-cos (theta/2))/2)/(sqrt((1+cos (theta/2))/2))=(1-cos(theta/2))/sin (theta/2)#
#tan (theta/4)=csc(theta/2)-cot(theta/2)#
Also #cot(theta/2)=sin theta/(1-cos theta)# Half-angle formula for cotangent.
We can use #theta# now
#tan (theta/4)=sqrt(2/(1-cos theta))-sin theta/(1-cos theta)#
Combine the three expressions
#f(theta)=sqrt((1+cos theta)/2)-(sqrt(2/(1-cos theta))-sin theta/(1-cos theta))+sqrt(2/(1+cos theta))#
Final answer after simplification
#f(theta)=((3+cos theta)*sqrt(2+2 cos theta))/(2+2 cos theta)+(sin theta-sqrt(2-2 cos theta))/(1-cos theta)#
Have a nice day from the Philippines !!!!!