dy/dx - 2y.cosecx=tan(x/2) between 0<x<pi

Having some trouble with this one - I have taken e^integral of 2cosecx - which I got (tan(x/2))^2 - Then I multiplied this to all terms and I am not sure if what I'm getting is working so a full explanation would be really appreciated.

Many thanks,

Bryn