Primitive of x over 1 plus Sine of a x

Theorem

 * $\displaystyle \int \frac {x \ \mathrm d x} {1 + \sin a x} = -\frac x a \tan \left({\frac \pi 4 - \frac {a x} 2}\right) + \frac 2 {a^2} \ln \left\vert{\sin \left({\frac \pi 4 + \frac {a x} 2}\right)}\right\vert + C$

Proof
With a view to expressing the primitive in the form:
 * $\displaystyle \int u \frac {\mathrm d v}{\mathrm d x} \ \mathrm d x = u v - \int v \frac {\mathrm d u}{\mathrm d x} \ \mathrm d x$

let:

and let:

Then:

Then:

Putting it all together:


 * $\displaystyle \int \frac {x \ \mathrm d x} {1 - \sin a x} = -\frac x a \tan \left({\frac \pi 4 - \frac {a x} 2}\right) + \frac 2 {a^2} \ln \left\vert{\sin \left({\frac \pi 4 + \frac {a x} 2}\right)}\right\vert + C$