By definition of csc and cot,
csc²(x) - 2 csc(x) cot(x) + cot²(x) = …
… = 1/sin²(x) - 2 cos(x) / sin²(x) + cos²(x) / sin²(x)
Combining fractions,
… = (1 - 2 cos(x) + cos²(x)) / sin²(x)
Factorize the numerator and use the Pythagorean identity,
cos²(x) + sin²(x) = 1,
to rewrite the denominator.
… = (1 - cos(x))² / (1 - cos²(x))
Cancel a factor of 1 - cos(x).
… = (1 - cos(x)) / (1 + cos(x))
Using the half-angle identities,
sin²(x) = (1 - cos(2x))/2
cos²(x) = (1 + cos(2x))/2
it follows that
1 - cos(x) = 2 sin²(x/2)
1 + cos(x) = 2 cos²(x/2)
and so
… = (2 sin²(x/2)) / (2 cos²(x/2))
… = sin²(x/2) / cos²(x/2)
Finally, by definition of tangent,
… = tan²(x/2)