# How to integrate following indefinite integal?

The integral is

$$\int\frac{x-\sin x}{1-\cos x} \,dx$$

However, the only guess I have is that the denominator is the derivative of the numerator. Probably the integration by substitution will work here?

• I have not worked out entirely, but would multiplying both denominator and numerator by $(1+\cos x)$ work? – peterwhy Sep 4 '15 at 22:14
• try the $1-\cos(x)=2 \sin^2 (\frac{x}{2})$ substitution – Mihail Sep 4 '15 at 22:18
• try $1-\cos(x)=2\sin^2(x/2)$ after separating into two integrals $\int \frac x{2\sin^2(x/2)}\operatorname d x-\int \frac{\sin x}{1-\cos x}\operatorname d x$ – Graham Kemp Sep 4 '15 at 22:21

\begin{align*} \int\frac{x-\sin x}{1-\cos x}dx &= \int \frac{(x-\sin x)(1+\cos x)}{(1-\cos x)(1+\cos x)}\ dx \\ &= \int \frac{x + x\cos x - \sin x -\sin x \cos x}{1-\cos^2 x}\ dx\\ &= \int (x\csc ^2 x + x \cot x \csc x - \csc x - \cot x)\ dx\\ &= -\int x\ d(\cot x) - \int x\ d(\csc x) - \int \csc x\ dx - \int \cot x\ dx\\ &= -x \cot x + \int \cot x\ dx - x\csc x + \int \csc x\ dx - \int \csc x\ dx - \int \cot x\ dx\\ &= -x \cot x - x\csc x + C\\ &= -x(\cot x + \csc x) + C \end{align*}