Primitive of x by Square of Cotangent of a x

Theorem

 * $\displaystyle \int x \cot^2 a x \ \mathrm d x = \frac {-x \cot a x} a + \frac 1 {a^2} \ln \left\vert{\sin a x}\right\vert - \frac {x^2} 2 + 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:

and let:

Then:

Also see

 * Primitive of $x \sin^2 a x$
 * Primitive of $x \cos^2 a x$
 * Primitive of $x \tan^2 a x$
 * Primitive of $x \sec^2 a x$
 * Primitive of $x \csc^2 a x$