Question:
Evaluate the following integrals:
$\int x \operatorname{cosec}^{2} x d x$
Solution:
Let $I=\int x \operatorname{cosec}^{2} x d x$
Using integration by parts,
$I=x \int \operatorname{cosec}^{2} x d x-\int \frac{d}{d x} x \int \operatorname{cosec}^{2} x d x$
We know that, $\int \operatorname{cosec}^{2} x d x=-\cot x$ and $\int \cot x d x=\log |\sin x|$
$=x \times-\cot x-\int-\cot x d x$
$=-x \cot x+\log |\sin x|+c$