Integral $\int\csc^3{x} \ dx$

Okay, your actual question is about integrating $\csc x$ (the rest doesn't matter).

You are fine with $$\int \csc x\,dx = \int\frac{\csc x(\csc x -\cot x)}{\csc x - \cot x}\,dx = \int\frac{\csc^2 x - \csc x \cot x}{\csc x - \cot x}\,dx.$$

The next step is just a basic substitution. Let $w = \csc x - \cot x$. Then $dw = (-\csc x\cot x + \csc^2x) \,dx$. This happens to be the numerator of the integral we have, while the denominator is $w$. So $$\int\frac{\csc^2x - \csc x\cot x}{\csc x- \cot x}\,dx = \int\frac{dw}{w}.$$

But instead of doing the substution explicitly, they wrote that the numerator, $(\csc^2x - \csc x\cot x)\,dx$ was the differential of the denominator, $\csc x - \cot x$.


The question seems to be why the following are equal:

$$(\csc^2 x - \csc x \cot x)\,dx = d(-\cot x + \csc x)$$

The answer is that $$ \frac{d}{dx} \cot x = -\csc^2 x\quad \text{ and }\quad\frac{d}{dx} \csc x = -\csc x \cot x. $$

The quotient rule for derivatives can establish both of these identities if you know how to differentiate the sine and cosine and some simple trigonometric identities.

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

And similarly,

$$ \frac{d}{dx} \csc x = \frac{d}{dx} \frac{1}{\sin x} = \frac{- \frac{d}{dx} \sin x}{\sin^2 x} = \frac{-\cos x}{\sin^2 x} = -\;\frac{1}{\sin x}\frac{\cos x}{\sin x} = -\csc x \cot x. $$