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

Theorem

 * $\ds \int \frac {\rd x} {p \sin a x + q \paren {1 + \cos a x} } = \frac 1 {a p} \ln \size {q + p \tan \frac {a x} 2} + C$

Proof
Let $z = a x$.

Then $\d x = \dfrac {\d z} a$ and so:

$(1): \quad \ds \int \frac {\rd x} {p \sin a x + q \paren {1 + \cos a x} } = \dfrac 1 a \int \frac {\rd z} {p \sin z + q \paren {1 + \cos z} }$

Then: