Evaluating a common integral for $\arcsin(x)$ using a different method 
The common method of evaluating the integral below is by using the substitution $x = a \sin u$ which gives: 
  $$\int\frac{dx}{\sqrt{a^2-x^2}}= \arcsin\Bigl(\frac xa\Bigr) + C.$$
  But, using this substitution led me down a path that seems to give a different answer (or, at least, a different form). Did I make a mistake, or are the two forms somehow equivalent?

$$x = ai\tan u $$
$$x^2=-a^2\tan^2(u)du$$
$$dx = ai\sec^2(u)du$$
$$1+\tan^2(u)=\sec^2(u)$$
\begin{align}
\int\frac{dx}{\sqrt{a^2-x^2}} & = \int\frac{1}{\sqrt{a^2+a^2\tan^2(u)}}\cdot ai\sec^2(u)du \\
 & = ai\int \frac{\sec^2(u)}{\sqrt{a^2(1+\tan^2(u))}}du \\ 
 & = \frac{ai}{a} \int \frac {\sec^2(u)}{\sec(u)}du \\
 & = i \int \sec(u)du \\ 
 & =i \ln \lvert \sec(u)+\tan(u)\rvert + C \\
& = i \ln \bigl| \frac {\sqrt{x^2-a^2}}{ai} + \frac {x}{ai}  \bigr| + C \\
& = i \ln \bigl| \frac {-i\sqrt{x^2-a^2}}{a} - \frac {ix}{a}  \bigr| + C \\
& = i \ln \bigl| -i\frac {\sqrt{x^2-a^2}+x}{a} \bigr| + C\\
& = i \Big[ \ln \lvert -i \rvert + \ln \bigl|\frac {\sqrt{x^2-a^2}+x}{a} \bigr| \Big] + C\\
& = i \ln \bigl|\frac {\sqrt{x^2-a^2}+x}{a} \bigr| + C
\end{align}

First, we have for complex $u$
$$\int \sec(u)\,du=\log(\sec(u)+\tan(u))+C$$
Next, we note that for $x=ia\tan(u)$ and $a\ge x$
$$\begin{align}
i\log(\sec(u)+\tan(u))+C&=i\log\left(\frac{\sqrt{x^2-a^2}}{ia}+\frac{x}{ia}\right)+C\\\\
&=i\log(x+i\sqrt{a^2-x^2})+C'\\\\
&=-\arctan\left(\frac{\sqrt{a^2-x^2}}{x}\right)+C''\\\\
&=\arctan\left(\frac{x}{\sqrt{a^2-x^2}}\right)+C'''\\\\
&=\arcsin(x/a)+C''''
\end{align}$$
And we are done.
