Primitive of Reciprocal of p plus q by Cosine of a x

Theorem

 * $\displaystyle \int \frac {\mathrm d x} {p + q \cos a x} = \begin{cases}

\displaystyle \frac 2 {a \sqrt {p^2 - q^2} } \arctan \left({\sqrt {\frac {p - q} {p + q} } \tan \dfrac {a x} 2}\right) + C & : p^2 > q^2 \\ \displaystyle \frac 1 {a \sqrt {q^2 - p^2} } \ln \left\vert{\frac {\tan \dfrac {a x} 2 + \sqrt {\dfrac {q + p} {q - p} } } {\tan \dfrac {a x} 2 - \sqrt {\dfrac {q + p} {q - p} } } }\right\vert + C & : p^2 < q^2 \\ \end{cases}$

Proof 1
Let $p^2 > q^2$.

Then, by Sign of Quotient of Factors of Difference of Squares:
 * $\dfrac {p + q} {p - q} > 0$

Thus, let $\dfrac {p + q} {p - q} = d^2$.

Then:

Now let $p^2 < q^2$.

Then, by Sign of Quotient of Factors of Difference of Squares:
 * $\dfrac {p + q} {p - q} < 0$

Thus, let:
 * $-\dfrac {p + q} {p - q} = d^2$

or:
 * $\dfrac {q + p} {q - p} = d^2$

Then:

Proof 2
Let $p^2 > q^2$.

Thus, let $p^2 - q^2 = d^2$.

Then:

Now let $p^2 < q^2$.

Also see

 * Primitive of $\dfrac 1 {p + q \sin a x}$


 * Primitive of $\dfrac 1 {p + q \tan a x}$


 * Primitive of $\dfrac 1 {p + q \cot a x}$


 * Primitive of $\dfrac 1 {q + p \sec a x}$


 * Primitive of $\dfrac 1 {q + p \csc a x}$