#f(theta)=-2csc(theta/4)-cot(theta/2)+2sin(theta/4)#
#=2sin(theta/4)-2/sin(theta/4)-cot(theta/2)#
#=(2sin^2(theta/4)-2)/sin(theta/4)-(2cos^2(theta/2))/(2sin(theta/2)cos(theta/2))#
#=(-2(1-sin^2(theta/4)))/sin(theta/4)-(1+costheta)/sintheta#
#=(-2cos^2(theta/4))/sin(theta/4)-(1+costheta)/sintheta#
#=(-2(1+cos(theta/2)))/sqrt(1/2(1-cos(theta/2)))-(1+costheta)/sintheta#
#=(-2(1+sqrt(1/2(1+costheta))))/sqrt(1/2(1-cos(theta/2)))-(1+costheta)/sintheta#
#=(-2(1+sqrt(1/2(1+costheta))))/sqrt(1/2(1-sqrt(1/2(1+costheta))))-(1+costheta)/sintheta#