# Integrate the square root of tangent [duplicate]

Find $\displaystyle \int \sqrt{\tan(x)}dx$.

According to an integral calculator, the answer to this question is $$(-2 \tan^{-1}(1-\sqrt(2) \sqrt(\tan(x)))+2 \tan^{-1}(\sqrt(2) \sqrt(\tan(x))+1)+\log(\tan(x)-\sqrt(2) \sqrt(\tan(x))+1)-\log(\tan(x)+\sqrt(2) \sqrt(\tan(x))+1))/(2 \sqrt(2))+C.$$

Is the question as complicated as the answer looks?

Notice, let $\sqrt{\tan x}=u\implies \frac{\sec^2x}{2\sqrt{\tan x}}\ dx=du$ or $dx=\frac{2u}{1+u^4}\ du$

$$\int \sqrt{\tan x}\ dx=\int u\frac{2u}{1+u^4}\ du$$ $$=\int \frac{2}{u^2+\frac{1}{u^2}}\ du$$ $$=\int \frac{\left(1+\frac{1}{u^2}\right)+\left(1-\frac{1}{u^2}\right)}{u^2+\frac{1}{u^2}}\ du$$

$$=\int \frac{\left(1+\frac{1}{u^2}\right)}{\left(u-\frac{1}{u}\right)^2+2}\ du+\int \frac{\left(1-\frac{1}{u^2}\right)}{\left(u+\frac{1}{u}\right)^2-2}\ du$$

$$=\int \frac{d\left(u-\frac{1}{u}\right)}{\left(u-\frac{1}{u}\right)^2+(\sqrt2)^2}+\int \frac{d\left(u+\frac{1}{u}\right)}{\left(u+\frac{1}{u}\right)^2-(\sqrt2)^2}$$ $$=\frac{1}{\sqrt 2}\tan^{-1}\left(\frac{u-\frac{1}{u}}{\sqrt 2}\right)+\frac{1}{2\sqrt 2}\ln\left|\frac{u+\frac{1}{u}-\sqrt 2}{u+\frac{1}{u}+\sqrt 2}\right|+c$$

• Explain the next step? – John Ryan Dec 21 '15 at 4:29
• next step is clear you need apply formula & substitute the value of $u=\sqrt {\tan x}$ back in the final expression – Harish Chandra Rajpoot Dec 21 '15 at 4:36
• How did you go from the second-to-last step to the last step? – John Ryan Dec 21 '15 at 15:22

setting $t=\sqrt{\tan(x)}$ then we get $$dt=\frac{1}{2}(\tan(x)^{-1/2}(1+\tan(x)^2)dx$$ and from here we get $$\frac{2\sqrt{\tan(x)}}{1+\tan(x)^2}dt=dx$$ and expressing by $t$ we get $$dx=\frac{2t}{1+t^4}dt$$