Primitive of x over Power of Cosine of a x

Theorem

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

This leads to:

Also see

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