∫1/(1-cos(x)) dx

Multiply the numerator and the denomintor by (1+cos(x))

= ∫(1+cos(x)) / [(1+cos(x))(1-cos(x))] dx

= ∫(1+cos(x)) / (1-cosē(x)) dx

= ∫(1+cos(x)) / sinē(x)) dx

= ∫(cscē(x) + csc(x)cot(x)) dx

= -cot(x) - csc(x) + c

= -[(cos(x) + 1) / sin(x)] + c

Your start was excellent. It pays to know how to integrate cscē(x).