Concept:
• Half-angle identities: \( 1 - \cos x = 2\sin^2(x/2) \) and \( \sin x = 2\sin(x/2)\cos(x/2) \).
• Integration by parts: \( \int u \, dv = uv - \int v \, du \).
• Basic integral: \( \int \text{cosec}^2(ax) \, dx = -\frac{1}{a}\cot(ax) \).
Step 1: Simplify the integrand using trigonometric identities
Let \( I = \int \frac{x - \sin x}{1 - \cos x} \, dx \).
Substitute \( 1 - \cos x = 2\sin^2(x/2) \) and \( \sin x = 2\sin(x/2)\cos(x/2) \):
\[ I = \int \left( \frac{x}{2\sin^2(x/2)} - \frac{2\sin(x/2)\cos(x/2)}{2\sin^2(x/2)} \right) \, dx \]
\[ I = \int \left( \frac{x}{2}\text{cosec}^2(x/2) - \cot(x/2) \right) \, dx \]
Step 2: Split the integral and apply integration by parts to the first term
\[ I = \int \frac{x}{2}\text{cosec}^2(x/2) \, dx - \int \cot(x/2) \, dx \]
For the first integral \( I_1 = \int \frac{x}{2}\text{cosec}^2(x/2) \, dx \), let \( u = x \) and \( dv = \frac{1}{2}\text{cosec}^2(x/2) \, dx \).
Then \( du = dx \) and \( v = \int \frac{1}{2}\text{cosec}^2(x/2) \, dx = -\cot(x/2) \).
Applying integration by parts:
\[ I_1 = x(-\cot(x/2)) - \int (-\cot(x/2)) \, dx \]
\[ I_1 = -x\cot(x/2) + \int \cot(x/2) \, dx \]
Step 3: Combine the results
Substituting the value of \( I_1 \) back into the expression for \( I \):
\[ I = \left( -x\cot(x/2) + \int \cot(x/2) \, dx \right) - \int \cot(x/2) \, dx \]
The integral terms cancel out:
\[ I = -x\cot(x/2) + C \]