Given:
#f(theta)=sec(theta/4)-tan(theta/2+pi/2)#
#tan(theta/2+pi/2) = -cot(theta/2)#
Thus,
#f(theta)=sec(theta/4)-( -cot(theta/2))#
Simplifying,
#f(theta)=sec(theta/4)+cot(theta/2)#
#theta/2 = 2theta/4#
Replacing, we get
#f(theta)=sec(theta/4)+cot(2theta/4)#
Further, we know that
#sec(theta/4) = 1/cos(theta/4)#
and
#cot(2theta/4) = cos(2theta/4)/sin(2theta/4)#
Substituting the same,
#f(theta)=1/cos(theta/4)+cos(2theta/4)/sin(2theta/4)#
#cos(2theta/4) =cos^2(theta/4) - sin^2 (theta/4) #
#sin(2theta/4) = 2sin(theta/4)cos(theta/4)#
Now,
#f(theta)=1/cos(theta/4)+(cos^2(theta/4) - sin^2 (theta/4))/(2sin(theta/4)cos(theta/4)#
#=1/cos(theta/4)+cos^2(theta/4)/(2sin(theta/4)cos(theta/4))-sin^2 (theta/4)/(2sin(theta/4)cos(theta/4)#
#1/cos(theta/4)=sec(theta/4)#
#cos^2(theta/4)/(2sin(theta/4)cos(theta/4))=(1/2)cot(theta/4)#
#sin^2 (theta/4)/(2sin(theta/4)cos(theta/4))=(1/2)tan(theta/4)#
Then,
#1/cos(theta/4)+cos^2(theta/4)/(2sin(theta/4)cos(theta/4))-sin^2 (theta/4)/(2sin(theta/4)cos(theta/4))=#
#sec(theta/4)+(1/2)cot(theta/4)-(1/2)tan(theta/4)#
Taking #1/2# common in all the terms, we have
#f(theta)=(1/2)(2sec(theta/4)+cot(theta/4)-tan(theta/4))#