# Primitive of Reciprocal of p by Sine of a x plus q by Cosine of a x plus or minus Root of p squared plus q squared

## Theorem

$\displaystyle \int \frac {\mathrm d x} {p \sin a x + q \cos a x \pm \sqrt {p^2 + q^2} } = \frac {-1} {a \sqrt {p^2 + q^2} } \tan \left({\frac \pi 4 \mp \frac {a x + \arctan \frac q p} 2}\right) + C$

### Primitive of $\dfrac 1 {p \sin a x + q \cos a x + \sqrt{p^2 + q^2}}$

$\ds \int \frac {\d x} {p \sin a x + q \cos a x + \sqrt {p^2 + q^2} } = \frac {-1} {a \sqrt {p^2 + q^2} } \map \tan {\frac \pi 4 - \frac {a x + \arctan \frac q p} 2} + C$

### Primitive of $\dfrac 1 {p \sin a x + q \cos a x - \sqrt{p^2 + q^2}}$

$\ds \int \frac {\d x} {p \sin a x + q \cos a x - \sqrt {p^2 + q^2} } = \frac {-1} {a \sqrt {p^2 + q^2} } \map \tan {\frac \pi 4 + \frac {a x + \arctan \frac q p} 2} + C$