Just applying Integration by Substitution for the given equation (Method#1 & Method#2), Let,
$$F(x)=\int \left ( \frac{dx}{\sqrt[]{a^{2}-x^{2}}} \right )\\\tag{1}$$
$\underline{Method \ No.\ 1:}$
Let, $$ x=acos(\theta)$$
$$x^{2}=a^{2}cos^{2}(\theta)$$
$$dx=-asin(\theta)d\theta$$
$$\frac{x^{2}}{a^{2}}=cos^{2}(\theta)$$
$$\theta= cos^{-1}(\frac{x}{a})\\\tag{2}$$
Putting values of $x$ & $dx$ in Eq.(1),
$$F(x)= \int \left ( \frac{-asin(\theta)d\theta}{\sqrt[]{a^{2}-x^{2}}} \right)$$
$$F(x)=\int \left ( \frac{-asin(\theta)d\theta}{a\sqrt[]{1-cos^{2}\theta}} \right)$$
As, $sin^{2}\theta+cos^{2}\theta = 1$ then,
$$F(x)=(-1) \int \left ( \frac{sin(\theta)}{sin(\theta)} \right )d\theta$$
$$F(x)= (-1) \theta$$
Putting value of $\theta$ from Eq.(2):
$$\boxed{F(x)= - cos^{-1}(\frac{x}{a})}\\\tag{3}$$
$\underline{Method \ No.\ 2:}$
Let, $$ x=asin(\theta)$$
$$x^{2}=a^{2}sin^{2}(\theta)$$
$$dx=acos(\theta)d\theta$$
$$\frac{x^{2}}{a^{2}}=sin^{2}(\theta)$$
$$\theta= sin^{-1}(\frac{x}{a})\\\tag{4}$$
Putting values of $x$ & $dx$ in Eq.(1),
$$F(x)= \int \left ( \frac{acos(\theta)d\theta}{\sqrt[]{a^{2}-x^{2}}} \right)$$
$$F(x)=\int \left ( \frac{acos(\theta)d\theta}{a\sqrt[]{1-sin^{2}\theta}} \right)$$
As, $sin^{2}\theta+cos^{2}\theta = 1$ then,
$$F(x)= \int \left ( \frac{cos(\theta)}{cos(\theta)} \right )d\theta$$
$$F(x)= \theta$$
Putting value of $\theta$ from Eq.(4):
$$\boxed{F(x)= sin^{-1}(\frac{x}{a})}\\\tag{5}$$
Now which of the Eq.(3) or Eq.(5) yields correct result and why ? As can be seen in the graph below, both have different graphs as functions and not equal.
Wolfram Mathematica gives result $F(x)=tan^{-1}(\frac{x}{\sqrt[]{a^{2}-x^{2}}})$ which by the way matches with Eq.(5) result.