Integral of $$$\frac{1}{1 - \cos{\left(x \right)}}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \frac{1}{1 - \cos{\left(x \right)}}\, dx$$$.
Solution
Rewrite the cosine using the double angle formula $$$\cos\left(x\right)=1-2\sin^2\left(\frac{x}{2}\right)$$$ and simplify:
$${\color{red}{\int{\frac{1}{1 - \cos{\left(x \right)}} d x}}} = {\color{red}{\int{\frac{1}{2 \sin^{2}{\left(\frac{x}{2} \right)}} d x}}}$$
Let $$$u=\frac{x}{2}$$$.
Then $$$du=\left(\frac{x}{2}\right)^{\prime }dx = \frac{dx}{2}$$$ (steps can be seen »), and we have that $$$dx = 2 du$$$.
The integral becomes
$${\color{red}{\int{\frac{1}{2 \sin^{2}{\left(\frac{x}{2} \right)}} d x}}} = {\color{red}{\int{\frac{1}{\sin^{2}{\left(u \right)}} d u}}}$$
Rewrite the integrand in terms of the cosecant:
$${\color{red}{\int{\frac{1}{\sin^{2}{\left(u \right)}} d u}}} = {\color{red}{\int{\csc^{2}{\left(u \right)} d u}}}$$
The integral of $$$\csc^{2}{\left(u \right)}$$$ is $$$\int{\csc^{2}{\left(u \right)} d u} = - \cot{\left(u \right)}$$$:
$${\color{red}{\int{\csc^{2}{\left(u \right)} d u}}} = {\color{red}{\left(- \cot{\left(u \right)}\right)}}$$
Recall that $$$u=\frac{x}{2}$$$:
$$- \cot{\left({\color{red}{u}} \right)} = - \cot{\left({\color{red}{\left(\frac{x}{2}\right)}} \right)}$$
Therefore,
$$\int{\frac{1}{1 - \cos{\left(x \right)}} d x} = - \cot{\left(\frac{x}{2} \right)}$$
Add the constant of integration:
$$\int{\frac{1}{1 - \cos{\left(x \right)}} d x} = - \cot{\left(\frac{x}{2} \right)}+C$$
Answer
$$$\int \frac{1}{1 - \cos{\left(x \right)}}\, dx = - \cot{\left(\frac{x}{2} \right)} + C$$$A