Primitive of x by Square of Cosecant of a x

Theorem

$\displaystyle \int x \csc^2 a x \ \mathrm d x = \frac {-x \cot a x} a + \frac 1 {a^2} \ln \left\vert{\sin a x}\right\vert + C$

Proof

With a view to expressing the primitive in the form:

$\displaystyle \int u \frac {\mathrm d v}{\mathrm d x} \ \mathrm d x = u v - \int v \frac {\mathrm d u}{\mathrm d x} \ \mathrm d x$

let:

 $\displaystyle u$ $=$ $\displaystyle x$ $\displaystyle \implies \ \$ $\displaystyle \frac {\mathrm d u} {\mathrm d x}$ $=$ $\displaystyle 1$ Derivative of Identity Function

and let:

 $\displaystyle \frac {\mathrm d v} {\mathrm d x}$ $=$ $\displaystyle \csc^2 a x$ $\displaystyle \implies \ \$ $\displaystyle v$ $=$ $\displaystyle \frac {-\cot a x} a$ Primitive of $\csc^2 a x$

Then:

 $\displaystyle \int x \csc^2 a x \ \mathrm d x$ $=$ $\displaystyle \frac {-x \cot a x} a - \int \frac {-\cot a x} a \ \mathrm d x + C$ Integration by Parts $\displaystyle$ $=$ $\displaystyle \frac {-x \cot a x} a + \frac 1 a \int \cot a x \ \mathrm d x + C$ Primitive of Constant Multiple of Function $\displaystyle$ $=$ $\displaystyle \frac {-x \cot a x} a + \frac 1 a \left({\frac 1 a \ln \left\vert{\sin a x}\right\vert}\right) + C$ Primitive of $\cot a x$ $\displaystyle$ $=$ $\displaystyle \frac {-x \cot a x} a + \frac 1 {a^2} \ln \left\vert{\sin a x}\right\vert + C$ simplifying

$\blacksquare$