I was calculating the antiderivative of the function $\frac{1}{\sqrt{2ax-x^2}}$. I got two different answers in two different ways.

**First way:** $$\int \frac{dx}{\sqrt{2ax-x^2}}=\int \frac{dx}{\sqrt x\cdot\sqrt{2a-x}}=2\int \frac{\frac{1}{2\sqrt x}dx}{\sqrt{2a-(\sqrt x)^2}}=\int \frac{d(\sqrt x)}{\sqrt{(\sqrt {2a})^2-(\sqrt x)^2}}=2\sin^{-1}\sqrt{\frac{x}{2a}}+c$$

**Second way:** $$\int \frac{dx}{\sqrt{2ax-x^2}}=\int \frac{dx}{\sqrt{a^2-(x-a)^2}}=\int \frac{d(x-a)}{\sqrt{a^2-(x-a)^2}}=\sin^{-1}\frac{x-a}{a}+c$$

It seems that $2\sin^{-1}\sqrt{\frac{x}{2a}}$ and $\sin^{-1}\frac{x-a}{a}$ are unequal. So I think one of my methods is wrong. But I've checked and found nothing wrong. So what is happening here? And if both of my methods are correct, how to show that these two expressions are equal?