Evaluate the integral $$ \int\frac{a^x}{\sqrt{1-a^{2x}}}\ dx $$
In a recent question, the OP asked what the problem was with their method and why it did not match the reference book. I tried the integration in my way and arrived at a yet different answer!
My Work
$$
\int\frac{a^x}{\sqrt{1-a^{2x}}}\ dx
$$
Let $1-a^{2x} = u^2$
$$
\begin{align}
\implies &-\color{red}{2}a^{2x}\ln a\ dx = \color{red}2\ u\ du \\
\implies &\ dx = \frac{u\ du}{-a^{2x}\ln a}
\end{align}
$$
Substituting in the values, I get,
$$
\begin{split}
\frac{-1}{\ln a}\int \frac{a^x\cdot \color{red}{u}\ du}{\color{red}{u}\cdot a^{2x}}& = \frac{-1}{\ln a} \int \frac{du}{\sqrt {1-u^2}}\\
& = \frac{- \sin ^{-1}(u)}{\ln a}
\end{split}
$$
Substituting in the value of $u$, I get:
$$
\boxed {\color{blue}{\frac{- \sin ^{-1}(\sqrt{1-a^{2x}})}{\ln a} + C}}
$$
However, the reference book has this as the answer:
$$
\boxed {\color{green}{\frac{\sin ^{-1}(a^{x})}{\ln a} + C} }
$$
Where have I gone wrong?