# Primitive of x over 1 minus Sine of a x

## Theorem

$\displaystyle \int \frac {x \rd x} {1 - \sin a x} = \frac x a \, \map \tan {\frac \pi 4 + \frac {a x} 2} + \frac 2 {a^2} \ln \size {\map \sin {\frac \pi 4 - \frac {a x} 2} } + C$

## Proof

With a view to expressing the primitive in the form:

$\displaystyle \int u \frac {\d v} {\d x} \rd x = u v - \int v \frac {\d u} {\d x} \rd x$

let:

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

and let:

 $\displaystyle \frac {\d v} {\d x}$ $=$ $\displaystyle \frac 1 {1 - \sin a x}$ $\displaystyle \leadsto \ \$ $\displaystyle v$ $=$ $\displaystyle \frac 1 a \map \tan {\frac \pi 4 + \frac {a x} 2}$ Primitive of Reciprocal of 1 minus Sine of a x

Then:

 $\displaystyle \int \frac {x \rd x} {1 - \sin a x}$ $=$ $\displaystyle x \paren {\frac 1 a \map \tan {\frac \pi 4 + \frac {a x} 2} } - \int \paren {\frac 1 a \map \tan {\frac \pi 4 + \frac {a x} 2} } \times 1 \rd x + C$ Integration by Parts $\displaystyle$ $=$ $\displaystyle \frac x a \map \tan {\frac \pi 4 + \frac {a x} 2} - \frac 1 a \int \map \tan {\frac \pi 4 + \frac {a x} 2} \rd x + C$ simplifying

Then:

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

Putting it all together:

$\displaystyle \int \frac {x \rd x} {1 - \sin a x} = \frac x a \map \tan {\frac \pi 4 + \frac {a x} 2} + \frac 2 {a^2} \ln \size {\map \sin {\frac \pi 4 - \frac {a x} 2} } + C$

$\blacksquare$