Answer
\[\, = - \cot \,\left( {\frac{x}{2}} \right) + C\]
Work Step by Step
\[\begin{gathered}
\int_{}^{} {\frac{{dx}}{{1 - \cos x}}} \hfill \\
\hfill \\
set\,\,x = 2{\tan ^{ - 1}}\,\left( u \right)\,\,\,\,\,\,then\,\,dx = 2\left( {\frac{{du}}{{1 + {u^2}}}} \right) \hfill \\
and\,\,\cos x = \frac{{1 - {u^2}}}{{1 + {u^2}}} \hfill \\
\hfill \\
substitute\,\,for\,dx{\text{ and }}\cos x \hfill \\
\hfill \\
\int_{}^{} {\frac{{dx}}{{1 - \cos x}}} \, = \int_{}^{} {\frac{{\frac{{2du}}{{1 + {u^2}}}}}{{1 - \frac{{1 - {u^2}}}{{1 + {u^2}}}}}} \, = \hfill \\
\hfill \\
simplify \hfill \\
\hfill \\
\int_{}^{} {\frac{1}{{{u^2}}}\,du} \hfill \\
\hfill \\
integrating \hfill \\
= - \frac{1}{u} + C \hfill \\
\hfill \\
substitute\,\,for\,\,\,u \hfill \\
\hfill \\
\, = - \cot \,\left( {\frac{x}{2}} \right) + C \hfill \\
\end{gathered} \]