Evaluating : $\int \frac{\sec x-\tan x}{\sqrt{\sin^2x-\sin x}} \mathrm{d}x$

calculusintegration

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.

Best Answer

Starting from

$$I=\int \frac {\mathrm{d}t}{(1+t)\sqrt{t^2-t}},$$

substitute $$\dfrac 1 {t+1}=u \implies t=\dfrac 1u-1, ~ dt=-\dfrac {du}{u^2}.$$ The integral becomes $$I=-\int \dfrac {du}{\sqrt {2u^2-3u+1}}.$$ Then since $$\int\frac{dx}{\sqrt{ax^2+bx+c}}=\frac{1}{\sqrt{a}}\ln\left|2\sqrt{a}\sqrt{ax^2+bx+c}+2ax+b\right|+c_1,$$ we have $$I=-\frac{1}{\sqrt{2}}\ln\left|2\sqrt{2}\sqrt{2u^2-3u+1}+4u-3\right|+c_1.$$ As $u=\dfrac{1}{t+1}$, $$I=-\frac{1}{\sqrt{2}}\ln\left|2\sqrt{2}\sqrt{\frac{t(t-1)}{(t+1)^2}}+\frac{4}{t+1}-3\right|+c_1.$$ And the original substitution $\sin x=t$ forms $$I=-\frac{1}{\sqrt{2}}\ln\left|2\sqrt{2}\sqrt{\frac{\sin x(\sin x-1)}{(\sin x+1)^2}}+\frac{4}{\sin x+1}-3\right|+c_1.$$

Related Question