Answer
\[\cot \frac{x}{2}+C\]
Work Step by Step
Let \[I=\int\frac{dx}{\cos x-1}\]
\[\left[\cos 2\theta-1=-2\sin^2\theta\right]\]
\[\left[\Rightarrow \cos\theta-1=-2\sin^2\frac{\theta}{2}\right]\]
\[I=\int\frac{dx}{-2\sin^2\frac{x}{2}}=-\frac{1}{2}\int\csc^2\frac{x}{2}dx\]
\[I=\frac{1}{2}\left[2\cot\frac{x}{2}\right]+C\]
\[I=\cot\frac{x}{2}+C\]
Hence $I=\cot\large\frac{x}{2}$ $+C$.