Primitive of Reciprocal of square of p plus q by Sine of a x

Theorem

 * $\ds \int \frac {\d x} {\paren {p + q \sin a x}^2} = \frac {q \cos a x} {a \paren {p^2 - q^2} \paren {p + q \sin a x} } + \frac p {p^2 - q^2} \int \frac {\d x} {p + q \sin a x}$

Proof
First a pair of lemmata:

Also see

 * Primitive of $\dfrac 1 {\paren {p + q \cos a x}^2}$