tan= sin/cos
cot= cos/sin
sec= (1/cos)^2
csc= (1/sin)^2
((sinx/cosx)-(cosx/sinx))/cosxsinx
now multiply cosxsinx into the denominator so you get
(sinx/cos^2xsinx)-(cosx/sin^2xcosx)
the numerator and the denominator cancels so you have
(1/cos^2x)-(1/sin^2x) which is the same as sec^2x-csc^2x