Indefinite Integration

Evaluate $\displaystyle\int \dfrac{\cot x}{\text{cosec }x - \cot x} dx$


$\begin{aligned} \text{Let } I & = \int \dfrac{\cot x}{\text{cosec }x - \cot x} dx \\\\ & = \int \dfrac{\cot x \left(\text{cosec }x + \cot x\right)}{\left(\text{cosec }x - \cot x\right) \left(\text{cosec }x + \cot x\right)} dx \\\\ & = \int \dfrac{\cot x \;\; \text{cosec }x + \cot^2 x}{\text{cosec}^2 x - \cot^2 x} dx \\\\ & = \int \cot x \;\; \text{cosec }x \;\; dx + \int \cot^2 x \;\; dx \;\;\;\; \left[\text{Note: }\text{cosec}^2 x - \cot^2 x = 1\right] \end{aligned}$

$\begin{aligned} \text{Now, } \int \cot^2 x \;\; dx & = \int \dfrac{\cos^2 x}{\sin^2 x} \;\; dx \\\\ & = \int \dfrac{1 - \sin^2 x}{\sin^2 x} \;\; dx \\\\ & = \int \dfrac{1}{\sin^2 x} \;\; dx - \int dx \\\\ & = \int \text{cosec}^2 x \;\; dx - \int dx \end{aligned}$

$\begin{aligned} \therefore I & = \int \cot x \;\; \text{cosec }x \;\; dx + \int \text{cosec}^2 x \;\; dx - \int dx \\\\ & = - \text{cosec }x - \cot x - x + c \end{aligned}$