What algebraic manipulation is used to express the solution to this integral? According to WolframAlpha, $$
\int \frac{2}{\sqrt{x^2 + 4}} dx = 2 \sinh^{-1}\left(\frac{x}{2}\right) + c.$$
I'm wondering how this was obtained, as I got the following:
Let $x = 2\tan\theta$. Then $dx = 2\sec^2\theta$, so \begin{align*}\int\frac{2}{\sqrt{x^2 + 4}}dx &= \int\frac{4\sec^2\theta}{\sqrt{4\tan^2\theta + 4}}d\theta = \int\frac{2\sec^2\theta}{\sqrt{\tan^2\theta + 1}}d\theta = 2\int\frac{\sec^2\theta}{\sec\theta}d\theta\\ &= 2\int\sec\theta{}d\theta = 2\ln\mid{\tan\theta + \sec\theta}\mid + c.\end{align*}
The substitution $x = 2\tan\theta$ implies that $\sec\theta = \frac{\sqrt{x^2 + 4}}{2}$ and $\tan\theta = \frac{x}{2}$. Hence $$
\int \frac{2}{\sqrt{x^2 + 4}} dx = 2\ln\left|{\frac{x}{2} +  \frac{\sqrt{x^2 + 4}}{2}}\right| + c.$$
Either I made a mistake or I don't know the right algebraic manipulation.

We could use hyperbolic trig substitution like Andre Nicolas mentioned.
Also, $$\sinh^{-1}(u) = \ln\left(u+\sqrt{1+u^2}\right).$$
