# What is the integral of $\sqrt{\tan x}$

I just need to know why is my method wrong: Let $$I=\int\sqrt{\tan x} dx$$, let $$\tan(x)=t^2$$ then, \begin{align*}&\sec^2(x)dx=2tdt\\ \implies&(1+\tan^2(x))dx=2tdt\\ \implies &dx=2tdt/(1+t^2)\end{align*}

So \begin{align*}I &= \int t\cdot \frac{2t}{1+t^2} dt\\ &= \int\frac{2t^2}{1+t^2}dt\end{align*} which can be solved easily. Is this method correct?

• Welcome to MSE. Please use MathJax to format your posts. May 20 '20 at 14:08
• "which can be solved easily": why don't you proceed ?
– user65203
May 20 '20 at 14:15

Let's flesh out @QuantumApple's hint. With $$\tan x=t^2$$,\begin{align}\int\sqrt{\tan x}dx&=\int\frac{2t^2dt}{1+t^4}\\&=\int\frac{1}{2}\left(\tfrac{1}{1-\sqrt{2}t+t^{2}}+\tfrac{1}{1+\sqrt{2}t+t^{2}}-\tfrac{1}{\sqrt{2}}\left(\tfrac{\sqrt{2}-2t}{1-\sqrt{2}t+t^{2}}+\tfrac{\sqrt{2}+2t}{1+\sqrt{2}t+t^{2}}\right)\right)dt\\&=\frac{1}{\sqrt{2}}\arctan(\sqrt{2\tan x}-1)+\frac{1}{\sqrt{2}}\arctan(\sqrt{2\tan x}+1)\\&+\frac{1}{2\sqrt{2}}\ln\left|\frac{\tan x-\sqrt{2\tan x}+1}{\tan x+\sqrt{2\tan x}+1}\right|+C.\end{align}
If $$\tan(x) = t^2$$ then $$1 + \tan^2(x) = 1 + t^4$$ (and not $$1 + t^2$$).