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

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?

• Did you mean to take the square root of something $<0$ when $0<\sin x<1$?
– J.G.
Apr 30, 2020 at 20:46
• Sorry. Mistake. Will edit that part out. Apr 30, 2020 at 20:56

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.$$

Substitute $$u=\frac 1t \implies dt =\frac{-1}{u^2} du$$ to get

$$-\int \frac{du}{(u+1)\sqrt{1-u}}$$

Now, substitute $$w=\sqrt{1-u} \implies dw=\frac{-1}{2\sqrt{1-u}} du$$

$$=2\int\frac{dw}{2-w^2}= \frac{1}{\sqrt 2} \log \left( \frac{w+\sqrt 2}{w-\sqrt 2} \right) + C$$

Reverting back to $$x$$, $$=\frac{1}{\sqrt 2}\log \left( \frac{\sqrt{\sin x +1} + \sqrt{2\sin x}}{\sqrt{\sin x-1} - \sqrt{2\sin x}} \right) + C$$

Note $$\sqrt{t^2-t}=\frac12\sqrt{(2t-1)^2-1}$$ and let $$\sec u = 2t-1$$

\begin{align} \int \frac {dt}{(1+t)\sqrt{t^2-t}} & = \int \frac{2}{1 + 3\cos u}du \\ &\hspace{-0.4cm}\overset{y = \tan \frac u2}= \int \frac{2dy}{2-y^2}dy=\frac1{\sqrt2}\ln |\frac{\sqrt2+y}{\sqrt2-y}|+C \end{align}