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

Theorem

 * $\ds \int \frac {\d x} {p \sin a x + q \cos a x + r} = \begin{cases}

\ds \frac 2 {a \sqrt {r^2 - p^2 - q^2} } \map \arctan {\frac {p + \paren {r - q} \tan \dfrac {a x} 2} {\sqrt {r^2 - p^2 - q^2} } } + C & : p^2 + q^2 < r^2 \\ \ds \frac 1 {a \sqrt {p^2 + q^2 - r^2} } \ln \size {\frac {p - \sqrt {p^2 + q^2 - r^2} + \paren {r - q} \tan \dfrac {a x} 2} {p + \sqrt {p^2 + q^2 - r^2} + \paren {r - q} \tan \dfrac {a x} 2} } + C & : p^2 + q^2 > r^2 \end{cases}$

Also see

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