Primitive of x by Square of Sine of a x

Theorem

 * $\displaystyle \int x \sin^2 a x \ \mathrm d x = \frac {x^2} 4 - \frac {x \sin 2 a x} {4 a} - \frac {\cos 2 a x} {8 a^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 \cos^2 a x$