Question:
Evaluate: $\int \frac{1}{1-\sin \frac{x}{2}} d x$
Solution:
Let $I=\frac{1}{1-\sin \frac{x}{2}} d x$
$=\frac{1}{1-\sin \frac{x}{2}} \mathrm{dx}$
Now, Multiply with the conjugate we get,
$=\int \frac{1}{1-\sin \frac{x}{2}} \times \frac{1+\sin \frac{x}{2}}{1+\sin \frac{x}{2}} d x$
$=\int \frac{1+\sin ^{\frac{x}{2}}}{1-\sin ^{2} \frac{x}{2}} d x$
$=\int \frac{1+\sin ^{\frac{x}{2}}}{\cos ^{2} \frac{x}{2}} d x$
$=\int \frac{1}{\cos ^{2} \frac{x}{2}} d x+\int \frac{\sin \frac{x}{2}}{\cos ^{2} \frac{x}{2}} d x$
$=\int \sec ^{2} \frac{x}{2} d x+\int \tan \frac{x}{2} \cdot \sec \frac{x}{2} d x$
$=\frac{\left(\tan \frac{x}{2}\right)}{\frac{1}{2}}+\frac{\left(\sec \frac{x}{2}\right)}{\frac{1}{2}}$
Hence, $I=2 \tan \frac{x}{2}+2 \sec \frac{x}{2}+C$