Primitive of x by Square of Tangent of a x

Theorem

 * $\ds \int x \tan^2 a x \rd x = \frac {x \tan a x} a + \frac 1 {a^2} \ln \size {\cos a x} - \frac {x^2} 2 + C$

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

let:

and let:

Then:

Also see

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