Let I=∫1+2cotx(cosecx+cotx)dx
⇒I=∫(2cotxcosecx+cosec2x+cot2x)dx
⇒I=∫(cosecx+cotx)2dx
⇒I=∫∣cosecx+cotx∣dx
⇒I=∫(cosecx+cotx)dx
⇒I=log∣tan2x∣+log∣sinx∣+c, where c is the constant of integration.
⇒I=log(cos2xsin2x⋅2sin2xcos2x)+c
⇒I=2log∣sin2x∣+c