Integral $\int\csc^3{x} \ dx$ I found these step which explain how to integrate $\csc^3{x} \ dx$. I understand everything, except the step I highlighted below.
How did we go from:
$$\int\frac{\csc^2 x - \csc x \cot x}{\csc x - \cot x}\,dx%$$
to 
$$\int \frac{d(-\cot x + \csc x)}{-\cot x + \csc x} \quad?$$
Thank you for your time!
$$
\int \csc^3 x\,dx = \int\csc^2x \csc x\,dx$$
To integrate by parts, let $dv = \csc^2x$ and $u=\csc x$. Then $v=-\cot x$ and $du = -\cot x \csc x \,dx$.
Integrating by parts, we have:
$$\begin{align*}
\int\csc^2 x \csc x \,dx &= -\cot x \csc x - \int(-\cot x)(-\cot x\csc x\,dx)\\
&= -\cot x \csc x - \int \cot^2 x \csc x\,dx\\
&= -\cot x\csc x - \int(\csc^2x - 1)\csc x\,dx &\text{(since }\cot^2 x = \csc^2-1\text{)}\\
&= -\cot x \csc x - \int(\csc^3 x - \csc x)\,dx\\
&= -\cot x\csc x - \int\csc^3 x\,dx + \int \csc x\,dx
\end{align*}$$
From
$$\int \csc^3 x\,dx = -\cot x\csc x - \int\csc^3 x\,dx + \int \csc x\,dx$$
we obtain
$$\begin{align*}
\int\csc^3x\,dx + \int\csc^3 x\,dx &= -\cot x \csc x + \int\csc x\,dx\\
2\int\csc^3 x\,dx &= -\cot x\csc x + \int\csc x\,dx\\
\int\csc^3x\,dx &= -\frac{1}{2}\cot x\csc x + \frac{1}{2}\int\csc x\,dx\\
&=-\frac{1}{2}\cot x\csc x + \frac{1}{2}\int\frac{\csc x(\csc x - \cot x)}{\csc x - \cot x}\,dx\\
&= -\frac{1}{2}\cot x \csc x + \frac{1}{2}\int\frac{\csc^2 x - \csc x\cot x}{\csc x - \cot x}\,dx\\
&= -\frac{1}{2}\cot x \csc x + \frac{1}{2}\int\frac{d(-\cot x+\csc x)}{-\cot x +\csc x}\\
&= -\frac{1}{2}\cot x\csc x + \frac{1}{2}\ln|\csc x - \cot x|+ C
\end{align*}$$
 A: 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$. 
A: 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.
$$
A: Alternatively, you can integrate by parts as follows
$$I=\int \csc^3 x\ dx$$
$$I=\int \csc x\ \csc^2 x\ dx$$
$$I=\csc x\int  \csc^2 x\ dx-\int (-\csc x\cot x) (-\cot  x)\ dx$$
$$I=-\csc x\cot x-\int  \csc x\cot^2  x\ dx$$
$$I=-\csc x\cot x-\int  \csc x (\csc^2  x-1)\ dx$$
$$I=-\csc x\cot x-\int  (\csc^3x -\csc x)\ dx$$
$$I=-\csc x\cot x-\int  \csc^3 x\ dx+\int \csc x\ dx$$
$$I=-\csc x\cot x-I+\int \csc x\ dx$$
$$2I=-\csc x\cot x+\ln\left|\tan\frac x2\right|$$
$$I=-\frac12\csc x\cot x+\frac12\ln\left|\tan\frac x2\right|+c$$
$$\boxed{\color{blue}{\int \csc^3 x\ dx=-\frac12\csc x\cot x+\frac12\ln\left|\tan\frac x2\right|+c}}$$
