# 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:

 $\ds u$ $=$ $\ds \tan \frac z 2$ $\ds \leadsto \ \$ $\ds \int \frac {\rd z} {p \sin z + q \paren {1 + \cos z} }$ $=$ $\ds \int \frac {\frac {2 \rd u} {\paren {1 + u^2} } } {p \frac {2 u} {1 + u^2} + q \paren {1 + \frac {1 - u^2} {1 + u^2} } }$ Weierstrass Substitution $\ds$ $=$ $\ds \int \frac {2 \rd u} {2 p u + q \paren {1 + u^2 + 1 - u^2} }$ multiplying top and bottom by $1 + u^2$ $\ds$ $=$ $\ds \int \frac {\d u} {p u + q}$ simplifying $\ds$ $=$ $\ds \frac 1 p \ln \size {p u + q} + C$ Primitive of $\dfrac 1 {a x + b}$ $\ds$ $=$ $\ds \frac 1 p \ln \size {q + p \tan \frac z 2} + C$ substituting for $u$ $\ds$ $=$ $\ds \frac 1 {a p} \ln \size {q + p \tan \frac {a x} 2} + C$ from $(1)$

$\blacksquare$