<s>[INST] Integrating the following $\int \sqrt{\tan x+1}\,dx$ 
Question: Integrate the following, $$\int\sqrt{\tan x+1}\;dx.$$

Wolfram Alpha returns a non-elementary answer. Can someone please spot the mistake I have made here:
First consider this integral: 
$$\int \frac{1}{(x+1)\sqrt{x+3}} \, dx = -\sqrt{2}\tanh^{-1}\frac{\sqrt{x+3}}{\sqrt{2}} + c$$
Wolfram Alpha confirms that result. 
Then, we have
$$I=\int \sqrt{\tan x+1} \, dx, \quad \tan x=u+2,
\quad dx=\frac{du}{\sec^{2}x}=\frac{du}{(u+2)^{2}-1}=\frac{dx}{(u+3)(u+1)}$$
So this transforms the integral to the first integral on this post, which we can evaluate. Then after evaluation and resubstitution I get:
$$I=-\sqrt{2}\tanh^{-1}\frac{\sqrt{\tan x+1}}{\sqrt{2}}+c$$
However differentiating this with Wolfram Alpha gives me a messy trigonometric expression which doesn't seem to be equal (I tested some values in both expressions and get different answers). I also estimated the area under the integral between some values and also obtained different answers using the closed form. Any ideas why?
EDIT: I used the wrong identity. Nevertheless, we can still use this method to integrate sqrt(tanhx integrals). E.g:
$$I=\int \sqrt{\tanh x+1} \, dx, \tanh x=u+2,\quad 
-dx = \frac{du}{\operatorname{sech}^2 x} = \frac{du}{(u+2)^2-1} = \frac{dx}{(u+3)(u+1)}$$
To obtain:
 $\int \sqrt{\tanh x+1} \, dx = I=\sqrt{2}\tanh^{-1} \dfrac{\sqrt{\tanh x+1}}{\sqrt{2}}+c$
 [/INST] This integral is not non-elementary. Following from @Harry Peter's hint, we have 
$$ \begin{align} \frac{2u^2}{u^4 - 2u^2 + 2} &= \frac{2}{u^2 + \dfrac{2}{u^2} - 2} \\ &= \frac{1 - \dfrac{\sqrt{2}}{u^2}}{\left(u+\dfrac{\sqrt{2}}{u}\right)^2-2\sqrt{2}-2} + \frac{1 + \dfrac{\sqrt{2}}{u^2}}{\left(u - \dfrac{\sqrt{2}}{u}\right)^2 + 2\sqrt{2} - 2 }
\end{align} $$
Then you can substitute $s = u + \dfrac{\sqrt{2}}{u}$ and $t = u - \dfrac{\sqrt{2}}{u}$, respectively.  The first integral is in terms of logarithms and the second is in terms of arctangent. As you can see, this can be expressed in terms of elementary functions.
</s>