<s>[INST] Calculation of $\int \sqrt{\tan x+2}dx$ Calculation of $\displaystyle \int\sqrt{\tan x+2}\;dx$
$\bf{My\; solution::}$ Let $\displaystyle \tan x+2 = t^2 $, Then 
$$\displaystyle \sec^2 (x)dx = 2tdt\Rightarrow dx = \frac{2t}{1+\tan^2 x}dt = \frac{2t}{1+(t^2-2)^2}dt$$
So Integral convert into $$\displaystyle \int \frac{2t^2}{(t^2-2)^2+1^2}dt$$
Let $\displaystyle (t^2-2) = u\Rightarrow t^2=u+2\;,$ Then $\displaystyle tdt=\frac{1}{2}du$
Now How can i solve after that
please help me
Thanks
 [/INST] Let
$$I=\int\sqrt{\tan x+2}\;dx,\>\>\>\>\> J=\int\frac1{\sqrt{\tan x+2}}\;dx
$$
and substitute  $\tan x= \sqrt5 t^2 -2$ to integrate
\begin{align}
I+\sqrt5 J
= &\ \frac2{\sqrt[4]5} 
\int \frac{1+\frac1{t^2}}{t^2+ \frac1{t^2}-\frac4{\sqrt5}}dt
=\frac{1}{\sqrt{\frac{\sqrt5}2-1}}
\tan^{-1}\frac{\sqrt[4]5(t-\frac1t)}{2\sqrt{\frac{\sqrt5}2-1}}\\
I-\sqrt5 J
= &\ \frac2{\sqrt[4]5} 
\int \frac{1-\frac1{t^2}}{t^2+ \frac1{t^2}-\frac4{\sqrt5}}dt
=-\frac{1}{\sqrt{\frac{\sqrt5}2+1}}
\coth^{-1}\frac{\sqrt[4]5(t+\frac1t)}{2\sqrt{\frac{\sqrt5}2+1}}
\end{align}
</s>