As a part of a bigger question, I was asked to evaluate the integral :
$$\int \frac{\sec x-\tan x}{\sqrt{\sin^2x-\sin x}} \mathrm{d}x$$
Here's what I tried: (Please bear with me, it gets quite lengthy)
$$\int \frac{\sec x-\tan x}{\sqrt{\sin^2x-\sin x}} \mathrm{d}x$$ $$=\int \frac{1-\sin x}{\cos x \sqrt{\sin^2x-\sin x}}\mathrm{d}x$$ $$=\int \frac{(1-\sin x) \cos x }{\sqrt{\sin^2 x-\sin x}(1-\sin^2 x)}\mathrm{d}x$$ $$=\int \frac{\cos x}{(\sqrt{\sin^2x -\sin x}(1+\sin x)}\mathrm{d}x$$ Substituting $\sin x= t$, we're left with a comparatively good-looking integral: $$\int \frac {\mathrm{d}t}{(1+t)\sqrt{t^2-t}}$$ Well, this integral looks simple and maybe is, but I'm having real trouble evaluating it : $$\frac12\int \frac{t+1-(t-1)}{(1+t)\sqrt{t^2-t}}\mathrm{d}t$$ $$=\frac12\left[\int \frac{\mathrm{d}t}{\sqrt{t^2-t}}-\int \frac{t-1}{\sqrt{t^2-t}}\mathrm{d}t\right]$$
Now this is getting longer than I expected it to. Can anyone help me find a shorter and quicker solution to this problem?
Thanks in advance.