[1-tan(x/2)]/[1+tan(x/2)] = [tan(π/4)-tan(x/2)]/[1+tan(π/4)tan(x/2)]
=tan(π/4-x/2)=(π-2)/2,
π/4-x/2 = arctan[(π-2)/2]
x=π/2-2arctan[(π-2)/2]
[1-tan(x/2)]/[1+tan(x/2)] = [tan(π/4)-tan(x/2)]/[1+tan(π/4)tan(x/2)]
=tan(π/4-x/2)=(π-2)/2,
π/4-x/2 = arctan[(π-2)/2]
x=π/2-2arctan[(π-2)/2]