Here is a second proof:
1−1+tan(x/2)2=1−1+sin(x)1−cos(x)2=1−1+sin(x)−cos(x)2sin(x)=1+sin(x)−cos(x)1−sin(x)−cos(x)⋅1−sin(x)−cos(x)1−sin(x)−cos(x)=(1−cos(x))2−sin2(x)(1−sin(x)−cos(x))2=1−2cos(x)+cos2(x)−sin2(x)(1−(sin(x)+cos(x)))2=2cos2(x)−2cos(x)1−2(sin(x)+cos(x))+sin2(x)+2sin(x)cos(x)+cos2(x)=−cos(x)(1−cos(x))1−sin(x)−cos(x)+sin(x)cos(x)=−cos(x)(1−cos(x))1−cos(x)+cos(x)(−1+cos(x))sin(x)(−1+cos(x))=−sec(x)+tan(x)
1−1+tan(x/2)2=1−1+sin(x)1−cos(x)2=1−1+sin(x)−cos(x)2sin(x)=1+sin(x)−cos(x)1−sin(x)−cos(x)⋅1−sin(x)−cos(x)1−sin(x)−cos(x)=(1−cos(x))2−sin2(x)(1−sin(x)−cos(x))2=1−2cos(x)+cos2(x)−sin2(x)(1−(sin(x)+cos(x)))2=2cos2(x)−2cos(x)1−2(sin(x)+cos(x))+sin2(x)+2sin(x)cos(x)+cos2(x)=−cos(x)(1−cos(x))1−sin(x)−cos(x)+sin(x)cos(x)=−cos(x)(1−cos(x))1−cos(x)+cos(x)(−1+cos(x))sin(x)(−1+cos(x))=−sec(x)+tan(x)