Primitive of x over Power of Sine of a x

Theorem

 * $\displaystyle \int \frac {x \rd x} {\sin^n a x} = \frac {-x \cos a x} {a \paren {n - 1} \sin^{n - 1} a x} - \frac 1 {a^2 \paren {n - 1} \paren {n - 2} \sin^{n - 2} a x} + \frac {n - 2} {n - 1} \int \frac {x \rd x} {\sin^{n - 2} a x}$

Proof
With a view to expressing the primitive in the form:
 * $\displaystyle \int u \frac {\d v} {\d x} \rd x = u v - \int v \frac {\d u} {\d x} \rd x$

let:

and let:

Then:

This leads to:

Also see

 * Primitive of $\dfrac x {\cos^n a x}$