As with most problems of this type, we'll solve it using a conjugate multiplication trick. Whenever you have something divided by something plus/minus something (as in #1/(cosx-1)#), it's always helpful to try conjugate multiplication, especially with trig functions.
We will begin by multiplying #1/(cosx-1)# by the conjugate of #cosx-1#, which is #cosx+1#:
#1/(cosx-1)*(cosx+1)/(cosx+1)#
You may wonder why we do this. It's so we can apply the difference of squares property, #(a-b)(a+b)=a^2-b^2#, in the denominator, to simplify it a little. Back to the problem:
#1/(cosx-1)*(cosx+1)/(cosx+1)=(cosx+1)/((cosx-1)(cosx+1))#
#(underbrace(cosx)-underbrace(1))(underbrace(cosx)+underbrace1))#
#color(white)(III)acolor(white)(XXX)bcolor(white)(XXX)acolor(white)(XXX)b#
Notice how this is essentially #(a-b)(a+b)#.
#=(cosx+1)/(cos^2x-1)#
Now, what about #cos^2x-1#? Well, we know #sin^2x=1-cos^2x#. Let's multiply that by #-1# and see what we get:
#-1(sin^2x=1-cos^2x)->-sin^2x=-1+cos^2x#
#=cos^2-1#
It turns out that #-sin^2x=cos^2x-1#, so let's replace #cos^2x-1#:
#(cosx+1)/(-sin^2x#
This is equivalent to #cosx/-sin^2x+1/-sin^2x#, which, using some trig, boils down to #-cotxcscx-csc^2x#.
At this point, we've simplified to integral #int1/(cosx-1)dx# to #int-cotxcscx-csc^2xdx#. Using the sum rule, this becomes:
#int-cotxcscxdx+int-csc^2xdx#
The first of these is #cscx# (because the derivative of #cscx# is #-cotxcscx#) and the second is #cotx# (because the derivative of #cotx# is #-csc^2x#). Add on the constant of integration #C# and you have your solution:
#int1/(cosx-1)dx=cscx+cotx+C#