Primitive of Reciprocal of p plus q by Cosine of a x/Weierstrass Substitution

Lemma for Primitive of Reciprocal of $p + q \cos a x$
The Weierstrass Substitution of $\displaystyle \int \frac {\mathrm d x} {p + q \cos a x}$ is:
 * $\displaystyle \frac 2 {a \left({p - q}\right)} \int \frac {\mathrm d u} {u^2 + \dfrac {p + q} {p - q} }$

where $u = \tan \dfrac {a x} 2$.