How many method are there to handle the integral $\int \frac{\sin x}{1-\sin x \cos x} d x$ $$
\begin{aligned}
\int \frac{\sin x}{1-\sin x \cos x} d x =& \frac{1}{2} \int \frac{(\sin x+\cos x)+(\sin x-\cos x)}{1-\sin x \cos x} d x \\
=& \int \frac{d(\sin x-\cos x)}{2-2 \sin x \cos x}-\int \frac{d(\sin x+\cos x)}{2-2 \sin x \cos x} \\
=& \int \frac{d(\sin x-\cos x)}{1+(\sin x-\cos x)^{2}}-\int \frac{d(\sin x+\cos x)}{3-(\sin x+\cos x)^{2}} \\
=& \tan ^{-1}(\sin x-\cos x)+\frac{1}{2 \sqrt{3}} \ln \left| \frac{\sin x+\cos x-\sqrt{3}}{\sin x+\cos x+\sqrt{3}} \right|+C
\end{aligned}
$$
Is there any other method?
 A: Multiplying both numerator and denominator of the integrand by $1+\sin x \cos x$ transforms the integral into
$$
\begin{aligned}
I &=\int \frac{\sin x(1+\sin x \cos x)}{1-\sin ^{2} x \cos ^{2} x} d x \\
&=\int \frac{\sin x d x}{1-\sin ^{2} x \cos ^{2} x}+\int \frac{\sin ^{2} x \cos x}{1-\sin ^{2} x \cos ^{2} x} d x \\
&=-  \underbrace{\int \frac{d c}{1-\left(1-c^{2}\right) c^{2}}}_{J}+  \underbrace{\int \frac{s^{2} d s}{1-s^{2}\left(1-s^{2}\right)}}_{K}
\end{aligned}
$$
where $c=\cos x$ and $s=\sin x.$
$$
\begin{aligned}
J&=-\int \frac{d c}{c^{4}-c^{2}+1}\\
&=-\int \frac{\frac{1}{c^{2}}}{c^{2}+\frac{1}{c^{2}}-1} d c
\end{aligned}
$$
Playing a little trick on the integrand gives
$$
\begin{aligned}
J &=-\frac{1}{2} \int \frac{\left(1+\frac{1}{c^{2}}\right)+\left(1-\frac{1}{c^{2}}\right)}{c^{2}+\frac{1}{c^{2}}-1} d c \\
&=-\frac{1}{2} \int \frac{d\left(c-\frac{1}{c}\right)}{\left(c-\frac{1}{c}\right)^{2}+1}+\frac{1}{2} \int \frac{d\left(c+\frac{1}{c}\right)}{\left(c+\frac{1}{c}\right)^{2}-3} \\
&=-\frac{1}{2} \tan ^{-1}\left(c-\frac{1}{c}\right)+\frac{1}{4 \sqrt{3}} \ln \left|\frac{c+\frac{1}{c}-\sqrt{3}}{c+\frac{1}{c}+\sqrt{3}}\right|+C_{1}
\end{aligned}
$$
Similarly,
$$
\begin{aligned}
K &=\int \frac{1}{s^{2}+\frac{1}{s^{2}}-1} d s \\
&=\frac{1}{2} \int \frac{\left(1+\frac{1}{s^{2}}\right)-\left(1-\frac{1}{s^{2}}\right)}{s^{2}+\frac{1}{s^{2}}-1} d s \\
&=\frac{1}{2} \tan ^{-1}\left(s-\frac{1}{s}\right)+\frac{1}{4 \sqrt{3}} \ln \left|\frac{s+\frac{1}{s}+\sqrt{3}}{s+\frac{1}{s}-\sqrt{3}}\right|+C_{2}
\end{aligned}
$$
Now we can conclude that
$$
\begin{aligned}
\therefore I=&-\frac{1}{2} \tan ^{-1}(\cos x-\sec x)+\frac{1}{2} \tan ^{-1}(\sin x-\csc x) \\
&+\frac{1}{4 \sqrt{3}} \ln \left|\frac{\cos ^{2} x-\sqrt{3} \cos x+1}{\cos ^{2} x+\sqrt{3} \cos x+1}\right|+\frac{1}{4 \sqrt{3}} \ln \left|\frac{\sin ^{2} x+\sqrt{3} \sin x+1}{\sin ^{2} x-\sqrt{3} \sin x+1}\right|+C
\end{aligned}
$$
A: Letting $y=\frac{\pi}{2}-x$ converts the integral into
$$
I=\int \frac{\cos y}{1-\sin y \cos y} d y
$$
Using the Weierstrass substitution, $t =\tan \frac{y}{2} $, we simplify and get
$$
I=-2 \int \frac{t^{2}-1}{t^{4}-2 t^{3}+2 t^{2}-2 t+1} d t
$$
Playing a little trick on the $I$ gives
$$
I =-2 \int \frac{1-\frac{1}{t^{2}}}{t^{2}+\frac{1}{t^{2}}-2\left(t+\frac{1}{t}\right)+2} d t =-2 \int \frac{d\left(t+\frac{1}{t}\right)}{t^{2}+\frac{1}{t^{2}}-2\left(t+\frac{1}{t}\right)+2}
$$
Letting $T=t+\frac{1}{t}$ yields
$$
\begin{aligned}
I &=-2 \int \frac{d T}{T^{2}-2 T} \\
&=-2 \int\left(\frac{1}{T-2}-\frac{1}{T}\right) d T \\
&=2 \ln \left|\frac{T}{T-2}\right|+C \\
&=2 \ln \left|\frac{t+\frac{1}{t}}{t+\frac{1}{t}-2}\right|+C\\&= 2 \ln \left|\frac{  \tan^2 \frac{y}{2}+1}{\tan ^{2} \frac{y}{2}-2 \tan \frac{y}{2}+1}\right|+C\\&= 2 \ln \left|\frac{\tan ^{2}\left(\frac{\pi}{4}+\frac{x}{2}\right)+1}{\tan ^{2}\left(\frac{\pi}{4}+\frac{x}{2}\right)-2 \tan \left(\frac{\pi}{4}+\frac{x}{2}\right)+1}\right|+C
\end{aligned}
$$
A: Using the tangent half-angle substitution
$$\int \frac{\sin (x)}{1-\sin (x) \cos (x)} \,d x=4\int \frac{t}{t^4+2 t^3+2 t^2-2 t+1}\,dt$$
The denominator has four roots
$$r_1=\frac{1}{2} \left(-1+\sqrt{3}-i \sqrt{2 \left(2-\sqrt{3}\right)}\right)\qquad r_2=\frac{1}{2} \left(-1+\sqrt{3}+i \sqrt{2 \left(2-\sqrt{3}\right)}\right)$$
$$r_3=\frac{1}{2} \left(-1-\sqrt{3}-i \sqrt{2 \left(2+\sqrt{3}\right)}\right)\qquad r_4=\frac{1}{2} \left(-1-\sqrt{3}+i \sqrt{2 \left(2+\sqrt{3}\right)}\right)$$ So, using partial fraction decomposition, four logarithms to be recombined.
