# Primitive of x over 1 minus 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:

 $\displaystyle u$ $=$ $\displaystyle x$ $\displaystyle \implies \ \$ $\displaystyle \frac {\mathrm d u} {\mathrm d x}$ $=$ $\displaystyle 1$ Derivative of Identity Function

and let:

 $\displaystyle \frac {\mathrm d v} {\mathrm d x}$ $=$ $\displaystyle \frac 1 {1 - \sin a x}$ $\displaystyle \implies \ \$ $\displaystyle v$ $=$ $\displaystyle \frac 1 a \tan \left({\frac \pi 4 + \frac {a x} 2}\right)$ Primitive of Reciprocal of 1 minus Sine of a x

Then:

 $\displaystyle \int \frac {x \ \mathrm d x} {1 - \sin a x}$ $=$ $\displaystyle x \left({\frac 1 a \tan \left({\frac \pi 4 + \frac {a x} 2}\right)}\right) - \int \left({\frac 1 a \tan \left({\frac \pi 4 + \frac {a x} 2}\right)}\right) \times 1 \ \mathrm d x + C$ Integration by Parts $\displaystyle$ $=$ $\displaystyle \frac x a \tan \left({\frac \pi 4 + \frac {a x} 2}\right) - \frac 1 a \int \tan \left({\frac \pi 4 + \frac {a x} 2}\right) \ \mathrm d x + C$ simplifying

Then:

 $\displaystyle z$ $=$ $\displaystyle \frac \pi 4 + \frac {a x} 2$ $\displaystyle \frac {\mathrm d z} {\mathrm d x}$ $=$ $\displaystyle \frac a 2$ Derivative of Power $\displaystyle \implies \ \$ $\displaystyle \frac 1 a \int \tan \left({\frac \pi 4 + \frac {a x} 2}\right) \ \mathrm d x$ $=$ $\displaystyle \frac 1 a \int \frac 2 a \tan z \ \mathrm d z$ Integration by Substitution $\displaystyle$ $=$ $\displaystyle -\frac 2 {a^2} \ln \left\vert{\cos z}\right\vert + C$ Primitive of Tangent Function $\displaystyle$ $=$ $\displaystyle -\frac 2 {a^2} \ln \left\vert{\cos \left({\frac \pi 4 + \frac {a x} 2}\right)}\right\vert + C$ substituting back for $z$ $\displaystyle$ $=$ $\displaystyle -\frac 2 {a^2} \ln \left\vert{\sin \left({\frac \pi 2 - \left({\frac \pi 4 + \frac {a x} 2}\right)}\right)}\right\vert + C$ Sine of Complement equals Cosine $\displaystyle$ $=$ $\displaystyle -\frac 2 {a^2} \ln \left\vert{\sin \left({\frac \pi 4 - \frac {a x} 2}\right)}\right\vert + C$

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$

$\blacksquare$