We have,
#tan^2(theta/2)=sin^2(theta/2)/cos^2(theta/2)xx2/2,#
#={2sin^2(theta/2)}/{2cos^2(theta/2)},#
#=(1-costheta)/(1+costheta),#
#:. tan(theta/2)=pmsqrt{(1-costheta)/(1+costheta)}.#
Letting, #theta=pi/4," so that, "theta/2=pi/8,# we have,
#tan(pi/8)=pmsqrt{(1-cos(pi/4))/(1+cos(pi/4))},#
#=pmsqrt{(1-1/sqrt2)/(1+1/sqrt2)},#
#=pmsqrt[{(sqrt2-1)/(sqrt2+1)}xx{(sqrt2-1)/(sqrt2-1)}],#
#=pmsqrt[{(sqrt2-1)^2)/(2-1)],#
#:. tan(pi/8)=pm(sqrt2-1).#
As #(pi/8)" lies in the "1^(st)# Quadrant, it is #+ve.#
# rArr tan(pi/8)=+(sqrt2-1).#
Enjoy Maths.!