Primitive of x over Power of Cosine of a x

Theorem

 * $\ds \int \frac {x \rd x} {\cos^n a x} = \frac {x \sin a x} {a \paren {n - 1} \cos^{n - 1} a x} - \frac 1 {a^2 \paren {n - 1} \paren {n - 2} \cos^{n - 2} a x} + \frac {n - 2} {n - 1} \int \frac {\d x} {\cos^{n - 2} a x} + 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:

This leads to:

Also see

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